anime-downloader bug fix
This commit is contained in:
@@ -1,10 +1,144 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<div>
|
||||
<form id="form_search" class="form-inline" style="text-align:left">
|
||||
<div class="container-fluid">
|
||||
<div class="row show-grid">
|
||||
<span class="col-md-4">
|
||||
<select id="order" name="order" class="form-control form-control-sm">
|
||||
<option value="desc">최근순</option>
|
||||
<option value="asc">오래된순</option>
|
||||
</select>
|
||||
<select id="option" name="option" class="form-control form-control-sm">
|
||||
<option value="all">전체</option>
|
||||
<option value="completed">완료</option>
|
||||
</select>
|
||||
</span>
|
||||
<span class="col-md-8">
|
||||
<input id="search_word" name="search_word" class="form-control form-control-sm w-75" type="text" placeholder="" aria-label="Search">
|
||||
<button id="search" class="btn btn-sm btn-outline-success">검색</button>
|
||||
<button id="reset_btn" class="btn btn-sm btn-outline-success">리셋</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div id='page1'></div>
|
||||
{{ macros.m_hr_head_top() }}
|
||||
{{ macros.m_row_start('0') }}
|
||||
{{ macros.m_col(2, macros.m_strong('Poster')) }}
|
||||
{{ macros.m_col(10, macros.m_strong('Info')) }}
|
||||
{{ macros.m_row_end() }}
|
||||
{{ macros.m_hr_head_bottom() }}
|
||||
<div id="list_div"></div>
|
||||
<div id='page2'></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript">
|
||||
var package_name = "{{arg['package_name']}}";
|
||||
var sub = "{{arg['sub']}}";
|
||||
var current_data = null;
|
||||
|
||||
$(document).ready(function(){
|
||||
global_sub_request_search('1');
|
||||
});
|
||||
|
||||
$("#search").click(function(e) {
|
||||
e.preventDefault();
|
||||
global_sub_request_search('1');
|
||||
});
|
||||
|
||||
$("body").on('click', '#page', function(e){
|
||||
e.preventDefault();
|
||||
global_sub_request_search($(this).data('page'));
|
||||
});
|
||||
|
||||
$("#reset_btn").click(function(e) {
|
||||
e.preventDefault();
|
||||
document.getElementById("order").value = 'desc';
|
||||
document.getElementById("option").value = 'all';
|
||||
document.getElementById("search_word").value = '';
|
||||
global_sub_request_search('1')
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click', '#json_btn', function(e){
|
||||
e.preventDefault();
|
||||
var id = $(this).data('id');
|
||||
for (i in current_data.list) {
|
||||
if (current_data.list[i].id == id) {
|
||||
m_modal(current_data.list[i])
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("body").on('click', '#self_search_btn', function(e){
|
||||
e.preventDefault();
|
||||
var search_word = $(this).data('title');
|
||||
document.getElementById("search_word").value = search_word;
|
||||
global_sub_request_search('1')
|
||||
});
|
||||
|
||||
$("body").on('click', '#remove_btn', function(e) {
|
||||
e.preventDefault();
|
||||
id = $(this).data('id');
|
||||
$.ajax({
|
||||
url: '/'+package_name+'/ajax/'+sub+ '/db_remove',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {id:id},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
$.notify('<strong>삭제되었습니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
global_sub_request_search(current_data.paging.current_page, false)
|
||||
} else {
|
||||
$.notify('<strong>삭제 실패</strong>', {
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#request_btn', function(e){
|
||||
e.preventDefault();
|
||||
var content_code = $(this).data('content_code');
|
||||
$(location).attr('href', '/' + package_name + '/' + sub + '/request?content_code=' + content_code)
|
||||
});
|
||||
|
||||
|
||||
|
||||
function make_list(data) {
|
||||
//console.log(data)
|
||||
str = '';
|
||||
for (i in data) {
|
||||
//console.log(data[i])
|
||||
str += m_row_start();
|
||||
str += m_col(1, data[i].id);
|
||||
tmp = (data[i].status == 'completed') ? '완료' : '미완료';
|
||||
str += m_col(1, tmp);
|
||||
tmp = data[i].created_time + '(추가)';
|
||||
if (data[i].completed_time != null)
|
||||
tmp += data[i].completed_time + '(완료)';
|
||||
str += m_col(3, tmp)
|
||||
tmp = data[i].savepath + '<br>' + data[i].filename + '<br><br>';
|
||||
tmp2 = m_button('json_btn', 'JSON', [{'key':'id', 'value':data[i].id}]);
|
||||
tmp2 += m_button('request_btn', '작품 검색', [{'key':'content_code', 'value':data[i].content_code}]);
|
||||
tmp2 += m_button('self_search_btn', '목록 검색', [{'key':'title', 'value':data[i].title}]);
|
||||
tmp2 += m_button('remove_btn', '삭제', [{'key':'id', 'value':data[i].id}]);
|
||||
tmp += m_button_group(tmp2)
|
||||
str += m_col(7, tmp)
|
||||
str += m_row_end();
|
||||
if (i != data.length -1) str += m_hr();
|
||||
}
|
||||
document.getElementById("list_div").innerHTML = str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,10 +1,130 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<div>
|
||||
{{ macros.m_button_group([['reset_btn', '초기화'], ['delete_completed_btn', '완료 목록 삭제'], ['go_ffmpeg_btn', 'Go FFMPEG']])}}
|
||||
{{ macros.m_row_start('0') }}
|
||||
{{ macros.m_row_end() }}
|
||||
{{ macros.m_hr_head_top() }}
|
||||
{{ macros.m_row_start('0') }}
|
||||
{{ macros.m_col(1, macros.m_strong('Idx')) }}
|
||||
{{ macros.m_col(2, macros.m_strong('CreatedTime')) }}
|
||||
{{ macros.m_col(4, macros.m_strong('Filename')) }}
|
||||
{{ macros.m_col(3, macros.m_strong('Status')) }}
|
||||
{{ macros.m_col(2, macros.m_strong('Action')) }}
|
||||
{{ macros.m_row_end() }}
|
||||
{{ macros.m_hr_head_bottom() }}
|
||||
<div id="download_list_div"></div>
|
||||
</div> <!--전체-->
|
||||
|
||||
<script type="text/javascript">
|
||||
var package_name = "{{arg['package_name'] }}";
|
||||
var sub = "{{arg['sub'] }}";
|
||||
var current_data = null;
|
||||
socket = io.connect(window.location.protocol + "//" + document.domain + ":" + location.port + "/" + package_name + '/' + sub);
|
||||
|
||||
$(document).ready(function(){
|
||||
});
|
||||
|
||||
socket.on('start', function(data){
|
||||
on_start();
|
||||
});
|
||||
socket.on('list_refresh', function(data){
|
||||
on_start()
|
||||
});
|
||||
|
||||
socket.on('status', function(data){
|
||||
on_status(data)
|
||||
});
|
||||
|
||||
|
||||
function on_start() {
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/' + sub + '/entity_list',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
make_download_list(data)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function on_status(data) {
|
||||
//console.log(data)
|
||||
tmp = document.getElementById("progress_"+data.entity_id)
|
||||
if (tmp != null) {
|
||||
document.getElementById("progress_"+data.entity_id).style.width = data.ffmpeg_percent+ '%';
|
||||
document.getElementById("progress_"+data.entity_id+"_label").innerHTML = data.ffmpeg_status_kor + "(" + data.ffmpeg_percent + "%)" + ' ' + ((data.ffmpeg_arg != null)?data.ffmpeg_arg.data.current_speed:'')
|
||||
}
|
||||
}
|
||||
|
||||
function make_download_list(data) {
|
||||
str = '';
|
||||
for (i in data) {
|
||||
str += m_row_start();
|
||||
str += m_col(1, data[i].entity_id);
|
||||
str += m_col(2, data[i].created_time);
|
||||
str += m_col(4, (data[i].filename != null) ? data[i].filename : '');
|
||||
|
||||
label = data[i].ffmpeg_status_kor
|
||||
if (data[i].ffmpeg_percent != 0) {
|
||||
label += '(' + data[i].ffmpeg_percent + '%)'
|
||||
}
|
||||
tmp = m_progress('progress_'+data[i].entity_id, data[i].ffmpeg_percent, label)
|
||||
str += m_col(3, tmp);
|
||||
tmp = m_button('program_cancel_btn', '취소', [{'key':'id', 'value':data[i].entity_id}]);
|
||||
tmp = m_button_group(tmp)
|
||||
str += m_col(2, tmp)
|
||||
str += m_row_end();
|
||||
if (i != data.length -1) str += m_hr(0);
|
||||
}
|
||||
document.getElementById("download_list_div").innerHTML = str;
|
||||
}
|
||||
|
||||
$("body").on('click', '#program_cancel_btn', function(e){
|
||||
e.preventDefault();
|
||||
entity_id = $(this).data('id')
|
||||
send_data = {'command':'cancel', 'entity_id':entity_id}
|
||||
queue_command(send_data)
|
||||
});
|
||||
|
||||
$("body").on('click', '#reset_btn', function(e){
|
||||
e.preventDefault();
|
||||
entity_id = $(this).data('id')
|
||||
send_data = {'command':'reset', 'entity_id':-1}
|
||||
queue_command(send_data)
|
||||
});
|
||||
|
||||
$("body").on('click', '#delete_completed_btn', function(e){
|
||||
e.preventDefault();
|
||||
entity_id = $(this).data('id')
|
||||
send_data = {'command':'delete_completed', 'entity_id':-1}
|
||||
queue_command(send_data)
|
||||
});
|
||||
|
||||
function queue_command(data) {
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/' + sub + '/queue_command',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret.ret == 'notify') {
|
||||
$.notify('<strong>'+ ret.log +'</strong>', {type: 'warning'});
|
||||
}
|
||||
on_start();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("body").on('click', '#go_ffmpeg_btn', function(e){
|
||||
e.preventDefault();
|
||||
$(location).attr('href', '/ffmpeg')
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -14,7 +14,7 @@
|
||||
const package_name = "{{arg['package_name'] }}";
|
||||
const sub = "{{arg['sub'] }}";
|
||||
const ohli24_url = "{{arg['ohli24_url']}}";
|
||||
const current_data = null;
|
||||
let current_data = null;
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
@@ -47,43 +47,44 @@
|
||||
});
|
||||
|
||||
function make_program(data) {
|
||||
const current_data = data;
|
||||
str = '';
|
||||
tmp = '<div class="form-inline">'
|
||||
tmp += m_button('check_download_btn', '선택 다운로드 추가', []);
|
||||
tmp += m_button('all_check_on_btn', '전체 선택', []);
|
||||
tmp += m_button('all_check_off_btn', '전체 해제', []);
|
||||
/*
|
||||
tmp += ' <input id="new_title" name="new_title" class="form-control form-control-sm" value="'+data.title+'">'
|
||||
tmp += '</div>'
|
||||
tmp += m_button('apply_new_title_btn', '저장폴더명, 파일명 제목 변경', []);
|
||||
tmp += m_button('search_tvdb_btn', 'TVDB', []);
|
||||
tmp = m_button_group(tmp)
|
||||
*/
|
||||
str += tmp
|
||||
// program
|
||||
str += m_hr_black();
|
||||
str += m_row_start(0);
|
||||
tmp = ''
|
||||
if (data.image != null)
|
||||
current_data = data;
|
||||
console.log(current_data)
|
||||
str = '';
|
||||
tmp = '<div class="form-inline">'
|
||||
tmp += m_button('check_download_btn', '선택 다운로드 추가', []);
|
||||
tmp += m_button('all_check_on_btn', '전체 선택', []);
|
||||
tmp += m_button('all_check_off_btn', '전체 해제', []);
|
||||
/*
|
||||
tmp += ' <input id="new_title" name="new_title" class="form-control form-control-sm" value="'+data.title+'">'
|
||||
tmp += '</div>'
|
||||
tmp += m_button('apply_new_title_btn', '저장폴더명, 파일명 제목 변경', []);
|
||||
tmp += m_button('search_tvdb_btn', 'TVDB', []);
|
||||
tmp = m_button_group(tmp)
|
||||
*/
|
||||
str += tmp
|
||||
// program
|
||||
str += m_hr_black();
|
||||
str += m_row_start(0);
|
||||
tmp = ''
|
||||
if (data.image != null)
|
||||
tmp = '<img src="' + data.image + '" class="img-fluid">';
|
||||
str += m_col(3, tmp)
|
||||
tmp = ''
|
||||
tmp += m_row_start(2) + m_col(3, '제목', 'right') + m_col(9, data.title) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '원제', 'right') + m_col(9, data.des._otit) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '감독', 'right') + m_col(9, data.des._dir) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '제작사', 'right') + m_col(9, data.des._pub) + m_row_end();
|
||||
{#tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag.join(' | ')) + m_row_end();#}
|
||||
str += m_col(3, tmp)
|
||||
tmp = ''
|
||||
tmp += m_row_start(2) + m_col(3, '제목', 'right') + m_col(9, data.title) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '원제', 'right') + m_col(9, data.des._otit) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '감독', 'right') + m_col(9, data.des._dir) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '제작사', 'right') + m_col(9, data.des._pub) + m_row_end();
|
||||
{#tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag.join(' | ')) + m_row_end();#}
|
||||
tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '분류', 'right') + m_col(9, data.des._classifi) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '방영일', 'right') + m_col(9, data.date+'('+data.day+')') + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '등급', 'right') + m_col(9, data.des._grade) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '줄거리', 'right') + m_col(9, data.ser_description) + m_row_end();
|
||||
str += m_col(9, tmp)
|
||||
str += m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '분류', 'right') + m_col(9, data.des._classifi) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '방영일', 'right') + m_col(9, data.date+'('+data.day+')') + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '등급', 'right') + m_col(9, data.des._grade) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '줄거리', 'right') + m_col(9, data.ser_description) + m_row_end();
|
||||
str += m_col(9, tmp)
|
||||
str += m_row_end();
|
||||
|
||||
str += m_hr_black();
|
||||
for (i in data.episode) {
|
||||
str += m_hr_black();
|
||||
for (i in data.episode) {
|
||||
str += m_row_start(); tmp = '';
|
||||
if (data.episode[i].thumbnail)
|
||||
tmp = '<img src="'+ data.episode[i].thumbnail + '" class="img-fluid">'
|
||||
@@ -99,9 +100,9 @@
|
||||
str += m_col(9, tmp)
|
||||
str += m_row_end();
|
||||
if (i != data.length -1) str += m_hr(0);
|
||||
}
|
||||
document.getElementById("episode_list").innerHTML = str;
|
||||
$('input[id^="checkbox_"]').bootstrapToggle()
|
||||
}
|
||||
document.getElementById("episode_list").innerHTML = str;
|
||||
$('input[id^="checkbox_"]').bootstrapToggle()
|
||||
}
|
||||
|
||||
$("body").on('click', '#go_ohli24_btn', function(e){
|
||||
@@ -118,6 +119,30 @@
|
||||
e.preventDefault();
|
||||
$('input[id^="checkbox_"]').bootstrapToggle('off')
|
||||
});
|
||||
|
||||
$("body").on('click', '#add_queue_btn', function(e){
|
||||
e.preventDefault();
|
||||
data = current_data.episode[$(this).data('idx')];
|
||||
console.log('data:::>', data)
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/' + sub + '/add_queue',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {data:JSON.stringify(data)},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.ret == 'enqueue_db_append' || data.ret == 'enqueue_db_exist') {
|
||||
$.notify('<strong>다운로드 작업을 추가 하였습니다.</strong>', {type: 'success'});
|
||||
} else if (data.ret == 'queue_exist') {
|
||||
$.notify('<strong>이미 큐에 있습니다. 삭제 후 추가하세요.</strong>', {type: 'warning'});
|
||||
} else if (data.ret == 'db_completed') {
|
||||
$.notify('<strong>DB에 완료 기록이 있습니다.</strong>', {type: 'warning'});
|
||||
} else {
|
||||
$.notify('<strong>추가 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user