Linkkf Fixes: resolve unknown sub add_queue and JS errors, refactor file handling, bump version to 0.7.16

This commit is contained in:
2026-01-27 16:01:52 +09:00
parent 31aaaaf8e9
commit 25688db376
4 changed files with 35 additions and 31 deletions

View File

@@ -49,7 +49,7 @@
const package_name = "{{arg['package_name'] }}";
const sub = "{{arg['sub'] }}";
const ohli24_url = "{{arg['ohli24_url']}}";
// let current_data = '';
var current_data = null;
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
@@ -288,26 +288,29 @@
$("body").on('click', '#add_queue_btn', function (e) {
e.preventDefault();
data = current_data.episode[$(this).data('idx')];
// console.log('data:::>', data)
let episode_data = current_data.episode[$(this).data('idx')];
// console.log('episode_data:::>', episode_data)
$.ajax({
url: '/' + package_name + '/ajax/' + sub + '/add_queue',
type: "POST",
cache: false,
data: {data: JSON.stringify(data)},
data: {data: JSON.stringify(episode_data)},
dataType: "json",
success: function (data) {
// console.log('#add_queue_btn::data >>', data)
if (data.ret == 'enqueue_db_append' || data.ret == 'enqueue_db_exist') {
success: function (ret) {
// console.log('#add_queue_btn::ret >>', ret)
if (ret.ret == 'enqueue_db_append' || ret.ret == 'enqueue_db_exist' || ret.ret == 'enqueue_gdm_success') {
$.notify('<strong>다운로드 작업을 추가 하였습니다.</strong>', {type: 'success'});
} else if (data.ret == 'queue_exist') {
} else if (ret.ret == 'queue_exist') {
$.notify('<strong>이미 큐에 있습니다. 삭제 후 추가하세요.</strong>', {type: 'warning'});
} else if (data.ret == 'db_completed') {
} else if (ret.ret == 'db_completed') {
$.notify('<strong>DB에 완료 기록이 있습니다.</strong>', {type: 'warning'});
} else if (data.ret == 'file_exists') {
} else if (ret.ret == 'file_exists') {
$.notify('<strong>파일이 이미 존재합니다.</strong>', {type: 'warning'});
} else if (ret.ret == 'extract_failed') {
$.notify('<strong>추가 실패: 영상 주소 추출에 실패하였습니다.</strong>', {type: 'warning'});
} else {
$.notify('<strong>추가 실패</strong><br>' + ret.log, {type: 'warning'});
const msg = ret.log || '알 수 없는 이유로 추가에 실패하였습니다.';
$.notify('<strong>추가 실패</strong><br>' + msg, {type: 'warning'});
}
}
});
@@ -316,13 +319,14 @@
$("body").on('click', '#check_download_btn', function (e) {
e.preventDefault();
let selected_data = [];
$('input[id^="checkbox_"]').each(function() {
if ($(this).prop('checked')) {
idx = parseInt($(this).attr('id').split('_')[1])
data.push(current_data.episode[idx]);
let idx = parseInt($(this).attr('id').split('_')[1]);
selected_data.push(current_data.episode[idx]);
}
});
if (data.length == 0) {
if (selected_data.length == 0) {
$.notify('<strong>선택하세요.</strong>', {type: 'warning'});
return;
}
@@ -330,9 +334,9 @@
url: '/' + package_name + '/ajax/' + sub + '/add_queue_checked_list',
type: "POST",
cache: false,
data: {data: JSON.stringify(data)},
data: {data: JSON.stringify(selected_data)},
dataType: "json",
success: function (data) {
success: function (ret) {
$.notify('<strong>백그라운드로 작업을 추가합니다.</strong>', {type: 'success'});
}
});
@@ -340,13 +344,14 @@
$("body").on('click', '#down_subtitle_btn', function (e) {
e.preventDefault();
let selected_data = [];
$('input[id^="checkbox_"]').each(function() {
if ($(this).prop('checked')) {
idx = parseInt($(this).attr('id').split('_')[1]);
data.push(current_data.episode[idx]);
let idx = parseInt($(this).attr('id').split('_')[1]);
selected_data.push(current_data.episode[idx]);
}
});
if (data.length == 0) {
if (selected_data.length == 0) {
$.notify('<strong>선택하세요.</strong>', {type: 'warning'});
return;
}
@@ -354,13 +359,14 @@
url: '/' + package_name + '/ajax/' + sub + '/add_sub_queue_checked_list',
type: "POST",
cache: false,
data: {data: JSON.stringify(data)},
data: {data: JSON.stringify(selected_data)},
dataType: "json",
success: function (data) {
if (data.ret == "success") {
success: function (ret) {
if (ret.ret == "success") {
$.notify('<strong>백그라운드로 자막 다운로드를 시작합니다.</strong>', {type: 'success'});
} else {
$.notify('<strong>자막 다운로드 요청 실패: ' + data.log + '</strong>', {type: 'warning'});
const msg = ret.log || '알 수 없는 이유로 요청에 실패하였습니다.';
$.notify('<strong>자막 다운로드 요청 실패: ' + msg + '</strong>', {type: 'warning'});
}
}
});