anime-downloader bug fix 21.
add search routine check download fix
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
aria-label="Basic example"
|
||||
>
|
||||
<button id="ing" type="button" class="btn btn-success">방영중</button>
|
||||
<button id="movie" type="button" class="btn btn-primary">극장판</button>
|
||||
<button id="theater" type="button" class="btn btn-primary">극장판</button>
|
||||
<button id="complete_anilist" type="button" class="btn btn-dark">
|
||||
완결
|
||||
</button>
|
||||
@@ -53,13 +53,16 @@
|
||||
const sub = "{{arg['sub'] }}";
|
||||
const ohli24_url = "{{arg['ohli24_url']}}";
|
||||
let current_data = null;
|
||||
let page = 1;
|
||||
let next_page = Number
|
||||
let current_cate = ''
|
||||
|
||||
const observer = lozad('.lozad', {
|
||||
rootMargin: '10px 0px', // syntax similar to that of CSS Margin
|
||||
threshold: 0.1, // ratio of element convergence
|
||||
enableAutoReload: true // it will reload the new image when validating attributes changes
|
||||
rootMargin: '10px 0px', // syntax similar to that of CSS Margin
|
||||
threshold: 0.1, // ratio of element convergence
|
||||
enableAutoReload: true // it will reload the new image when validating attributes changes
|
||||
});
|
||||
observer.observe();
|
||||
observer.observe();
|
||||
|
||||
|
||||
const get_anime_list = (type, page) => {
|
||||
@@ -70,12 +73,19 @@
|
||||
switch (type) {
|
||||
case 'ing':
|
||||
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||
current_cate = 'ing'
|
||||
break;
|
||||
case 'movie':
|
||||
url = '/' + package_name + '/ajax/'+sub+'screen_movie_list'
|
||||
url = '/' + package_name + '/ajax/'+sub+'/screen_movie_list'
|
||||
current_cate = 'movie'
|
||||
break;
|
||||
case 'complete':
|
||||
url = '/' + package_name + '/ajax/'+sub+'screen_movie_list'
|
||||
case 'theater':
|
||||
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||
current_cate = 'theater'
|
||||
break;
|
||||
case 'fin':
|
||||
url = '/' + package_name + '/ajax/'+sub+'/complete_list'
|
||||
current_cate = 'fin'
|
||||
break
|
||||
default:
|
||||
break;
|
||||
@@ -93,13 +103,16 @@
|
||||
|
||||
if (current_screen_movie_data !== '') {
|
||||
if (type === "ing") {
|
||||
make_airing_list(ret.data, page)
|
||||
// setTimeout(() => {
|
||||
// observer.observe();
|
||||
// }, 1000);
|
||||
observer.observe();
|
||||
make_airing_list(ret.data, page)
|
||||
observer.observe();
|
||||
} else if (type === "fin") {
|
||||
make_screen_movie_list(ret.data, page)
|
||||
observer.observe();
|
||||
} else if (type === "theater") {
|
||||
make_screen_movie_list(ret.data, page)
|
||||
observer.observe();
|
||||
} else {
|
||||
make_screen_movie_list(ret, page)
|
||||
make_screen_movie_list(ret.data, page)
|
||||
}
|
||||
div_visible = true
|
||||
console.log(div_visible)
|
||||
@@ -165,6 +178,14 @@
|
||||
str += '</div>';
|
||||
str += '<div id="inner_screen_movie" class="row infinite-scroll">';
|
||||
for (let i in data.anime_list) {
|
||||
if (data.anime_list[i].wr_id !== '') {
|
||||
const re = /bo_table=([^&]+)/
|
||||
const bo_table = data.anime_list[i].link.match(re)
|
||||
// console.log(bo_table)
|
||||
request_url = './request?code=' + data.anime_list[i].code + '&wr_id='+ data.anime_list[i].wr_id + '&bo_table='+bo_table[1]
|
||||
} else {
|
||||
request_url = './request?code=' + data.anime_list[i].code
|
||||
}
|
||||
|
||||
tmp = '<div class="col-sm-4">';
|
||||
tmp += '<div class="card">';
|
||||
@@ -174,7 +195,7 @@
|
||||
// {# '<span data-tooltip-text="'+data.episode[i].title+'">' + data.episode[i].code + '</span></button></div>';#}
|
||||
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
||||
tmp += '<p class="card-text">' + data.anime_list[i].code + '</p>';
|
||||
tmp += '<a href="./request?code=' + data.anime_list[i].code + '" class="btn btn-primary cut-text">' + data.anime_list[i].title + '</a>';
|
||||
tmp += '<a href="'+request_url+'" class="btn btn-primary cut-text">' + data.anime_list[i].title + '</a>';
|
||||
tmp += '</div>';
|
||||
tmp += '</div>';
|
||||
tmp += '</div>';
|
||||
@@ -215,11 +236,9 @@
|
||||
tmp += '<div class="card">';
|
||||
tmp += '<img class="card-img-top" src="' + data.anime_list[i].image_link + '" />';
|
||||
tmp += '<div class="card-body">'
|
||||
{#tmp += '<button id="code_button" data-code="' + data.episode[i].code + '" type="button" class="btn btn-primary code-button bootstrap-tooltip" data-toggle="button" data-tooltip="true" aria-pressed="true" autocomplete="off" data-placement="top">' +#}
|
||||
// {# '<span data-tooltip-text="'+data.episode[i].title+'">' + data.episode[i].code + '</span></button></div>';#}
|
||||
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
||||
tmp += '<p class="card-text">' + data.anime_list[i].code + '</p>';
|
||||
tmp += '<a href="./request?code=' + data.anime_list[i].code + '" class="btn btn-primary cut-text">' + data.episode[i].title + '</a>';
|
||||
tmp += '<a href="./request?code=' + data.anime_list[i].code + '" class="btn btn-primary cut-text">' + data.anime_list[i].title + '</a>';
|
||||
tmp += '</div>';
|
||||
tmp += '</div>';
|
||||
tmp += '</div>';
|
||||
@@ -299,10 +318,24 @@
|
||||
});
|
||||
|
||||
$('#anime_category #ing').on("click", function() {
|
||||
// {#console.log(this.id)#}
|
||||
let spinner = document.getElementById('spinner');
|
||||
spinner.style.visibility = 'visible';
|
||||
get_anime_list("ing", 1)
|
||||
})
|
||||
|
||||
$('#anime_category #complete_anilist').on("click", function() {
|
||||
// {#console.log(this.id)#}
|
||||
let spinner = document.getElementById('spinner');
|
||||
spinner.style.visibility = 'visible';
|
||||
get_anime_list("ing", 1)
|
||||
get_anime_list("fin", 1)
|
||||
})
|
||||
|
||||
$('#anime_category #theater').on("click", function() {
|
||||
// {#console.log(this.id)#}
|
||||
let spinner = document.getElementById('spinner');
|
||||
spinner.style.visibility = 'visible';
|
||||
get_anime_list("theater", 1)
|
||||
})
|
||||
|
||||
// 분석 버튼 클릭시 호출
|
||||
@@ -368,14 +401,77 @@
|
||||
});
|
||||
});
|
||||
// const observer = lozad();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// const el = document.querySelector('img');
|
||||
// const observer = lozad(el); // passing a `NodeList` (e.g. `document.querySelectorAll()`) is also valid
|
||||
// observer.observe();
|
||||
const loadNextAnimes = (cate, page) => {
|
||||
spinner.style.display = "block";
|
||||
const data = { type: cate, page: String(page) };
|
||||
let url = ''
|
||||
switch (cate) {
|
||||
case 'ing':
|
||||
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||
current_cate = 'ing'
|
||||
break;
|
||||
case 'movie':
|
||||
url = '/' + package_name + '/ajax/'+sub+'/screen_movie_list'
|
||||
current_cate = 'movie'
|
||||
break;
|
||||
case 'theater':
|
||||
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||
current_cate = 'theater'
|
||||
break;
|
||||
case 'fin':
|
||||
url = '/' + package_name + '/ajax/'+sub+'/complete_list'
|
||||
current_cate = 'fin'
|
||||
break
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
cache: "no-cache",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
body: new URLSearchParams(data),
|
||||
})
|
||||
.then((res) => res.json())
|
||||
.then((response) => {
|
||||
console.log("Success:", JSON.stringify(response));
|
||||
// {#imagesContainer.appendChild()#}
|
||||
console.log("return page:::> ", response.page);
|
||||
// {#page = response.page#}
|
||||
make_screen_movie_list(response.data, response.page);
|
||||
page++;
|
||||
next_page++;
|
||||
})
|
||||
.catch((error) => console.error("Error:", error));
|
||||
};
|
||||
|
||||
|
||||
const onScroll = (e) => {
|
||||
console.dir(e.target.scrollingElement.scrollHeight);
|
||||
const { scrollTop, scrollHeight, clientHeight } = e.target.scrollingElement;
|
||||
if (Math.round(scrollHeight - scrollTop) <= clientHeight) {
|
||||
document.getElementById("spinner").style.display = "block";
|
||||
console.log("loading");
|
||||
console.log("now page::> ", page);
|
||||
console.log("next_page::> ", next_page);
|
||||
loadNextAnimes(current_cate, next_page);
|
||||
}
|
||||
};
|
||||
|
||||
const debounce = (func, delay) => {
|
||||
let timeoutId = null;
|
||||
return (...args) => {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = setTimeout(func.bind(null, ...args), delay);
|
||||
};
|
||||
};
|
||||
|
||||
document.addEventListener("scroll", debounce(onScroll, 300));
|
||||
</script>
|
||||
<style>
|
||||
button.code-button {
|
||||
|
||||
@@ -1,368 +1,365 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
{% extends "base.html" %} {% block content %}
|
||||
|
||||
<div>
|
||||
<form id='program_list'>
|
||||
{{ macros.setting_input_text_and_buttons('code', '작품 Code', [['analysis_btn', '분석'], ['go_ohli24_btn', 'Go OHLI24']], desc='예) "https://ohli24.net/c/녹을 먹는 비스코" 이나 "녹을 먹는 비스코"') }}
|
||||
<form id="program_list">
|
||||
{{ macros.setting_input_text_and_buttons('code', '작품 Code',
|
||||
[['analysis_btn', '분석'], ['go_ohli24_btn', 'Go OHLI24']], desc='예)
|
||||
"https://ohli24.net/c/녹을 먹는 비스코" 이나 "녹을 먹는 비스코"') }}
|
||||
</form>
|
||||
<form id="program_auto_form">
|
||||
<div id='episode_list'></div>
|
||||
<div id="episode_list"></div>
|
||||
</form>
|
||||
</div> <!--전체-->
|
||||
</div>
|
||||
<!--전체-->
|
||||
|
||||
<script type="text/javascript">
|
||||
const package_name = "{{arg['package_name'] }}";
|
||||
const sub = "{{arg['sub'] }}";
|
||||
const ohli24_url = "{{arg['ohli24_url']}}";
|
||||
let current_data = null;
|
||||
const package_name = "{{arg['package_name'] }}";
|
||||
const sub = "{{arg['sub'] }}";
|
||||
const ohli24_url = "{{arg['ohli24_url']}}";
|
||||
let current_data = null;
|
||||
|
||||
const params = new Proxy(new URLSearchParams(window.location.search), {
|
||||
get: (searchParams, prop) => searchParams.get(prop),
|
||||
})
|
||||
|
||||
function findGetParameter(parameterName) {
|
||||
let result = null,
|
||||
tmp = [];
|
||||
const items = location.search.substr(1).split("&");
|
||||
for (let index = 0; index < items.length; index++) {
|
||||
tmp = items[index].split("=");
|
||||
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function analyze() {
|
||||
// e.preventDefault();
|
||||
const code = document.getElementById("code").value
|
||||
console.log(code)
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {code:code},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret.ret === 'success' && ret.data != null) {
|
||||
// {#console.log(ret.code)#}
|
||||
console.log(ret.data)
|
||||
make_program(ret.data)
|
||||
} else {
|
||||
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function make_program(data) {
|
||||
current_data = data;
|
||||
console.log("current_data::", 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();#}
|
||||
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.des._total_chapter) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '상영시간', 'right') + m_col(9, data.des._show_time) + 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_row_start(); tmp = '';
|
||||
if (data.episode[i].thumbnail)
|
||||
tmp = '<img src="'+ data.episode[i].thumbnail + '" class="img-fluid">'
|
||||
str += m_col(3, tmp)
|
||||
tmp = '<strong>' + data.episode[i].title+ '</strong>';
|
||||
tmp += '<br>';
|
||||
tmp += data.episode[i].date + '<br>';
|
||||
|
||||
tmp += '<div class="form-inline">'
|
||||
tmp += '<input id="checkbox_'+i+'" name="checkbox_'+i+'" type="checkbox" checked data-toggle="toggle" data-on="선 택" data-off="-" data-onstyle="success" data-offstyle="danger" data-size="small"> '
|
||||
tmp += m_button('add_queue_btn', '다운로드 추가', [{'key':'idx', 'value':i}])
|
||||
tmp += '</div>'
|
||||
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()
|
||||
}
|
||||
|
||||
$(function () {
|
||||
console.log(params.code)
|
||||
if (params.code === '') {
|
||||
|
||||
} else {
|
||||
document.getElementById("code").value = params.code
|
||||
// {#document.getElementById("analysis_btn").click();#}
|
||||
}
|
||||
|
||||
if ( "{{arg['ohli24_current_code']}}" !== "") {
|
||||
if (params.code === null) {
|
||||
console.log('params.code === null')
|
||||
document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
||||
|
||||
} else if(params.code === '') {
|
||||
document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
||||
} else {
|
||||
|
||||
console.log('params code exist')
|
||||
console.log(params.code)
|
||||
document.getElementById("code").value = params.code
|
||||
analyze()
|
||||
// document.getElementById("analysis_btn").click();
|
||||
// $('#analysis_btn').trigger('click')
|
||||
}
|
||||
// 값이 공백이 아니면 분석 버튼 계속 누름
|
||||
// {#document.getElementById("analysis_btn").click();#}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
});
|
||||
const params = new Proxy(new URLSearchParams(window.location.search), {
|
||||
get: (searchParams, prop) => searchParams.get(prop),
|
||||
})
|
||||
|
||||
|
||||
// $('#analysis_btn').unbind("click").bind('click', function (e) {
|
||||
// e.preventDefault();
|
||||
// e.stopPropagation()
|
||||
// console.log('test')
|
||||
// const code = document.getElementById("code").value
|
||||
// console.log(code)
|
||||
// })
|
||||
|
||||
// $("body").unbind('click', '#analysis_btn')
|
||||
// 분석 버튼 클릭시 호출
|
||||
// $("body").on('click', '#analysis_btn', function(e){
|
||||
$("#analysis_btn").unbind("click").bind('click', function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation()
|
||||
const code = document.getElementById("code").value
|
||||
console.log(code)
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {code:code},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret.ret === 'success' && ret.data != null) {
|
||||
// {#console.log(ret.code)#}
|
||||
console.log(ret.data)
|
||||
make_program(ret.data)
|
||||
} else {
|
||||
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
function findGetParameter(parameterName) {
|
||||
let result = null,
|
||||
tmp = [];
|
||||
const items = location.search.substr(1).split("&");
|
||||
for (let index = 0; index < items.length; index++) {
|
||||
tmp = items[index].split("=");
|
||||
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
$("body").on('click', '#go_ohli24_btn', function(e){
|
||||
e.preventDefault();
|
||||
window.open("{{arg['ohli24_url']}}", "_blank");
|
||||
});
|
||||
|
||||
$("body").on('click', '#all_check_on_btn', function(e){
|
||||
e.preventDefault();
|
||||
$('input[id^="checkbox_"]').bootstrapToggle('on')
|
||||
});
|
||||
|
||||
$("body").on('click', '#all_check_off_btn', function(e){
|
||||
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'});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("body").on('click', '#check_download_btn', function(e){
|
||||
e.preventDefault();
|
||||
all = $('input[id^="checkbox_"]');
|
||||
let data = [];
|
||||
let idx;
|
||||
for (let i in all) {
|
||||
if (all[i].checked) {
|
||||
idx = parseInt(all[i].id.split('_')[1])
|
||||
data.push(current_data.episode[idx]);
|
||||
}
|
||||
}
|
||||
if (data.length == 0) {
|
||||
$.notify('<strong>선택하세요.</strong>', {type: 'warning'});
|
||||
return;
|
||||
function analyze(wr_id, bo_table) {
|
||||
// e.preventDefault();
|
||||
const code = document.getElementById("code").value
|
||||
console.log(code)
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {code: code, wr_id: wr_id, bo_table: bo_table},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret.ret === 'success' && ret.data != null) {
|
||||
// {#console.log(ret.code)#}
|
||||
console.log(ret.data)
|
||||
make_program(ret.data)
|
||||
} else {
|
||||
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function make_program(data) {
|
||||
current_data = data;
|
||||
console.log("current_data::", 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();#}
|
||||
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.des._total_chapter) + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '상영시간', 'right') + m_col(9, data.des._show_time) + 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_row_start(); tmp = '';
|
||||
if (data.episode[i].thumbnail)
|
||||
tmp = '<img src="'+ data.episode[i].thumbnail + '" class="img-fluid">'
|
||||
str += m_col(3, tmp)
|
||||
tmp = '<strong>' + data.episode[i].title+ '</strong>';
|
||||
tmp += '<br>';
|
||||
tmp += data.episode[i].date + '<br>';
|
||||
|
||||
tmp += '<div class="form-inline">'
|
||||
tmp += '<input id="checkbox_'+i+'" name="checkbox_'+i+'" type="checkbox" checked data-toggle="toggle" data-on="선 택" data-off="-" data-onstyle="success" data-offstyle="danger" data-size="small"> '
|
||||
tmp += m_button('add_queue_btn', '다운로드 추가', [{'key':'idx', 'value':i}])
|
||||
tmp += '</div>'
|
||||
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()
|
||||
}
|
||||
|
||||
$(function () {
|
||||
console.log(params.wr_id)
|
||||
console.log(findGetParameter('wr_id'))
|
||||
console.log(params.code)
|
||||
if (params.code === '') {
|
||||
|
||||
} else {
|
||||
document.getElementById("code").value = params.code
|
||||
// {#document.getElementById("analysis_btn").click();#}
|
||||
}
|
||||
|
||||
if ( "{{arg['ohli24_current_code']}}" !== "") {
|
||||
if (params.code === null) {
|
||||
console.log('params.code === null')
|
||||
document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
||||
|
||||
} else if(params.code === '') {
|
||||
document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
||||
} else {
|
||||
|
||||
console.log('params code exist')
|
||||
console.log(params.code)
|
||||
document.getElementById("code").value = params.code
|
||||
|
||||
analyze(params.wr_id, params.bo_table)
|
||||
// document.getElementById("analysis_btn").click();
|
||||
// $('#analysis_btn').trigger('click')
|
||||
}
|
||||
// 값이 공백이 아니면 분석 버튼 계속 누름
|
||||
// {#document.getElementById("analysis_btn").click();#}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
console.log('wr_id::', params.wr_id)
|
||||
|
||||
});
|
||||
|
||||
$("#analysis_btn").unbind("click").bind('click', function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation()
|
||||
const code = document.getElementById("code").value
|
||||
console.log(code)
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/' + sub + '/add_queue_checked_list',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {data:JSON.stringify(data)},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$.notify('<strong>백그라운드로 작업을 추가합니다.</strong>', {type: 'success'});
|
||||
}
|
||||
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {code:code},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret.ret === 'success' && ret.data != null) {
|
||||
// {#console.log(ret.code)#}
|
||||
console.log(ret.data)
|
||||
make_program(ret.data)
|
||||
} else {
|
||||
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click', '#go_ohli24_btn', function(e){
|
||||
e.preventDefault();
|
||||
window.open("{{arg['ohli24_url']}}", "_blank");
|
||||
});
|
||||
|
||||
$("body").on('click', '#all_check_on_btn', function(e){
|
||||
e.preventDefault();
|
||||
$('input[id^="checkbox_"]').bootstrapToggle('on')
|
||||
});
|
||||
|
||||
$("body").on('click', '#all_check_off_btn', function(e){
|
||||
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'});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("body").on('click', '#check_download_btn', function(e){
|
||||
e.preventDefault();
|
||||
all = $('input[id^="checkbox_"]');
|
||||
let data = [];
|
||||
let idx;
|
||||
for (let i in all) {
|
||||
if (all[i].checked) {
|
||||
idx = parseInt(all[i].id.split('_')[1])
|
||||
data.push(current_data.episode[idx]);
|
||||
}
|
||||
}
|
||||
if (data.length == 0) {
|
||||
$.notify('<strong>선택하세요.</strong>', {type: 'warning'});
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/' + sub + '/add_queue_checked_list',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {data:JSON.stringify(data)},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$.notify('<strong>백그라운드로 작업을 추가합니다.</strong>', {type: 'success'});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
button.code-button { min-width: 82px!important;}
|
||||
.tooltip {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
button.code-button {
|
||||
min-width: 82px !important;
|
||||
}
|
||||
.tooltip {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
[data-tooltip-text]:hover {
|
||||
position: relative;
|
||||
}
|
||||
[data-tooltip-text]:hover {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
[data-tooltip-text]:after {
|
||||
-webkit-transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
||||
-moz-transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
||||
transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
||||
[data-tooltip-text]:after {
|
||||
-webkit-transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||
-moz-transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||
transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
|
||||
-webkit-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
-moz-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
-webkit-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
-moz-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
|
||||
color: #FFFFFF;
|
||||
font-size: 12px;
|
||||
margin-bottom: 10px;
|
||||
padding: 7px 12px;
|
||||
position: absolute;
|
||||
width: auto;
|
||||
min-width: 50px;
|
||||
max-width: 300px;
|
||||
word-wrap: break-word;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
margin-bottom: 10px;
|
||||
padding: 7px 12px;
|
||||
position: absolute;
|
||||
width: auto;
|
||||
min-width: 50px;
|
||||
max-width: 300px;
|
||||
word-wrap: break-word;
|
||||
|
||||
z-index: 9999;
|
||||
z-index: 9999;
|
||||
|
||||
opacity: 0;
|
||||
left: -9999px;
|
||||
top: 90%;
|
||||
opacity: 0;
|
||||
left: -9999px;
|
||||
top: 90%;
|
||||
|
||||
content: attr(data-tooltip-text);
|
||||
}
|
||||
content: attr(data-tooltip-text);
|
||||
}
|
||||
|
||||
[data-tooltip-text]:hover:after {
|
||||
top: 230%;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
}[data-tooltip-text]:hover {
|
||||
position: relative;
|
||||
}
|
||||
[data-tooltip-text]:hover:after {
|
||||
top: 230%;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
[data-tooltip-text]:hover {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
[data-tooltip-text]:after {
|
||||
-webkit-transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
||||
-moz-transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
||||
transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
||||
[data-tooltip-text]:after {
|
||||
-webkit-transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||
-moz-transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||
transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
|
||||
-webkit-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
-moz-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
-webkit-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
-moz-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
|
||||
color: #FFFFFF;
|
||||
font-size: 12px;
|
||||
margin-bottom: 10px;
|
||||
padding: 7px 12px;
|
||||
position: absolute;
|
||||
width: auto;
|
||||
min-width: 50px;
|
||||
max-width: 300px;
|
||||
word-wrap: break-word;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
margin-bottom: 10px;
|
||||
padding: 7px 12px;
|
||||
position: absolute;
|
||||
width: auto;
|
||||
min-width: 50px;
|
||||
max-width: 300px;
|
||||
word-wrap: break-word;
|
||||
|
||||
z-index: 9999;
|
||||
z-index: 9999;
|
||||
|
||||
opacity: 0;
|
||||
left: -9999px;
|
||||
top: -210%!important;
|
||||
opacity: 0;
|
||||
left: -9999px;
|
||||
top: -210% !important;
|
||||
|
||||
content: attr(data-tooltip-text);
|
||||
}
|
||||
content: attr(data-tooltip-text);
|
||||
}
|
||||
|
||||
[data-tooltip-text]:hover:after {
|
||||
top: 130%;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
[data-tooltip-text]:hover:after {
|
||||
top: 130%;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#airing_list {
|
||||
display: none;
|
||||
}
|
||||
#airing_list {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.cut-text {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#screen_movie_list {
|
||||
margin-top: 10px
|
||||
}
|
||||
.cut-text {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#screen_movie_list {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user