mirror of
https://github.com/evilhero/mylar
synced 2025-03-06 19:38:02 +00:00
FIX: Fix for Abort DDL option in DDL GUI not working due to hyphenated ID, IMP: Added Remove option for DDL downloads that are in a Failed/Incomplete/Completed status where it will remove the item from the history list, FIX: Corrected ',' being added when TPB information was being parsed for the collected display in the comic details pages for TPB/GN's
This commit is contained in:
parent
6ad338f070
commit
1407588785
3 changed files with 39 additions and 19 deletions
|
@ -106,9 +106,9 @@
|
|||
document.getElementById("status").innerHTML = status;
|
||||
qmm = document.getElementById("queue_menu");
|
||||
qmm.style.display = "inline-block";
|
||||
$("#qrestartddl").attr('onClick', "ajaxcallit('restart', "+aid+")");
|
||||
$("#qresumeddl").attr('onClick', "ajaxcallit('resume', "+aid+")");
|
||||
$("#qabortddl").attr('onClick', "ajaxcallit('abort', "+aid+")");
|
||||
$("#qrestartddl").attr('onClick', "ajaxcallit('restart', '"+aid+"')");
|
||||
$("#qresumeddl").attr('onClick', "ajaxcallit('resume', '"+aid+"')");
|
||||
$("#qabortddl").attr('onClick', "ajaxcallit('abort', '"+aid+"')");
|
||||
} else if ( status.indexOf("File does not exist") > -1){
|
||||
acm = document.getElementById("active_message");
|
||||
acm.style.display = "inline-block";
|
||||
|
@ -117,9 +117,9 @@
|
|||
document.getElementById("amessage").innerHTML = status;
|
||||
qmm = document.getElementById("queue_menu");
|
||||
qmm.style.display = "inline-block";
|
||||
$("#arestartddl").attr('onClick', "ajaxcallit('restart', "+aid+")");
|
||||
$("#aresumeddl").attr('onClick', "ajaxcallit('resume', "+aid+")");
|
||||
$("#aabortddl").attr('onClick', "ajaxcallit('abort', "+aid+")");
|
||||
$("#arestartddl").attr('onClick', "ajaxcallit('restart', '"+aid+"')");
|
||||
$("#aresumeddl").attr('onClick', "ajaxcallit('resume', '"+aid+"')");
|
||||
$("#aabortddl").attr('onClick', "ajaxcallit('abort', '"+aid+"')");
|
||||
} else {
|
||||
acm = document.getElementById("active_message");
|
||||
acm.style.display = "inline-block";
|
||||
|
@ -136,18 +136,29 @@
|
|||
}
|
||||
});
|
||||
};
|
||||
function ajaxcallit(mode, queueid) {
|
||||
alert(queueid);
|
||||
function ajaxcallit(qmode, queueid) {
|
||||
$.get("ddl_requeue",
|
||||
{ mode: mode, id: queueid },
|
||||
{ mode: qmode, id: queueid },
|
||||
function(data){
|
||||
if (data.error != undefined) {
|
||||
alert(data.error);
|
||||
return;
|
||||
}
|
||||
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>Successfully restarted DDL Queue</div>");
|
||||
$('#queue_table').DataTable().ajax.reload(null, false);
|
||||
var objd = JSON.parse(data);
|
||||
if (qmode == 'restart') {
|
||||
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>"+objd['message']+"</div>");
|
||||
} else if (qmode == 'resume') {
|
||||
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>"+objd['message']+"</div>");
|
||||
} else if (qmode == 'abort') {
|
||||
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>"+objd['message']+"</div>");
|
||||
} else if (qmode == 'remove') {
|
||||
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>"+objd['message']+"</div>");
|
||||
} else if (qmode == 'restart-queue') {
|
||||
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>"+objd['message']+"</div>");
|
||||
}
|
||||
});
|
||||
$('#ajaxMsg').addClass('success').fadeIn().delay(3000).fadeOut();
|
||||
$('#queue_table').DataTable().ajax.reload(null, false);
|
||||
};
|
||||
function initThisPage() {
|
||||
initActions();
|
||||
|
@ -186,10 +197,11 @@
|
|||
"visible": true,
|
||||
"render":function (data,type,full) {
|
||||
val = full[4]
|
||||
var restartline = "('ddl_requeue?mode=restart&id="+full[6]+"',$(this));"
|
||||
var resumeline = "('ddl_requeue?mode=resume&id="+full[6]+"',$(this));"
|
||||
var restartline = "('ddl_requeue?mode=restart&id="+String(full[6])+"',$(this));"
|
||||
var resumeline = "('ddl_requeue?mode=resume&id="+String(full[6])+"',$(this));"
|
||||
var removeline = "('ddl_requeue?mode=remove&id="+String(full[6])+"',$(this));"
|
||||
if (val == 'Completed' || val == 'Failed' || val == 'Downloading'){
|
||||
return '<span title="Restart"></span><a href="#" onclick="doAjaxCall'+restartline+'">Restart</a>';
|
||||
return '<span title="Restart"></span><a href="#" onclick="doAjaxCall'+restartline+'">Restart</a><span title="Remove"></span><a href="#" onclick="doAjaxCall'+removeline+'"><span class="ui-icon ui-icon-plus"></span>Remove</a>';
|
||||
} else if (val == 'Incomplete') {
|
||||
return '<span title="Restart"></span><a href="#" onclick="doAjaxCall'+restartline+'">Restart</a><span title="Resume"></span><a href="#" onclick="doAjaxCall'+resumeline+'"><span class="ui-icon ui-icon-plus"></span>Resume</a>';
|
||||
} else if (val == 'Queued') {
|
||||
|
|
|
@ -413,16 +413,16 @@ def GetComicInfo(comicid, dom, safechk=None):
|
|||
issuerun = issuerun[:srchline+len(x)]
|
||||
break
|
||||
except Exception as e:
|
||||
logger.warn('[ERROR] %s' % e)
|
||||
#logger.warn('[ERROR] %s' % e)
|
||||
continue
|
||||
else:
|
||||
iss_start = fc_name.find('#')
|
||||
issuerun = fc_name[iss_start:].strip()
|
||||
fc_name = fc_name[:iss_start].strip()
|
||||
|
||||
if issuerun.endswith('.') or issuerun.endswith(','):
|
||||
if issuerun.strip().endswith('.') or issuerun.strip().endswith(','):
|
||||
#logger.fdebug('Changed issuerun from %s to %s' % (issuerun, issuerun[:-1]))
|
||||
issuerun = issuerun[:-1]
|
||||
issuerun = issuerun.strip()[:-1]
|
||||
if issuerun.endswith(' and '):
|
||||
issuerun = issuerun[:-4].strip()
|
||||
elif issuerun.endswith(' and'):
|
||||
|
|
|
@ -2208,6 +2208,9 @@ class WebInterface(object):
|
|||
filesize = 0
|
||||
resume = filesize
|
||||
elif mode == 'abort':
|
||||
myDB.upsert("ddl_info", {'Status': 'Failed'}, {'id': id}) #DELETE FROM ddl_info where ID=?', [id])
|
||||
continue
|
||||
elif mode == 'remove':
|
||||
myDB.action('DELETE FROM ddl_info where ID=?', [id])
|
||||
continue
|
||||
else:
|
||||
|
@ -2221,15 +2224,20 @@ class WebInterface(object):
|
|||
'issueid': item['issueid'],
|
||||
'id': item['id'],
|
||||
'resume': resume})
|
||||
|
||||
linemessage = '%s successful for %s' % (mode, oneitem['series'])
|
||||
if mode == 'restart_queue':
|
||||
logger.info('[DDL-RESTART-QUEUE] DDL Queue successfully restarted. Put %s items back into the queue for downloading..' % len(itemlist))
|
||||
linemessage = 'Successfully restarted Queue'
|
||||
elif mode == 'restart':
|
||||
logger.info('[DDL-REQUEUE] Successfully restarted %s [%s] for downloading..' % (oneitem['series'], oneitem['size']))
|
||||
logger.info('[DDL-RESTART] Successfully restarted %s [%s] for downloading..' % (oneitem['series'], oneitem['size']))
|
||||
elif mode == 'requeue':
|
||||
logger.info('[DDL-REQUEUE] Successfully requeued %s [%s] for downloading..' % (oneitem['series'], oneitem['size']))
|
||||
elif mode == 'abort':
|
||||
logger.info('[DDL-ABORT] Successfully aborted downloading of %s [%s]..' % (oneitem['series'], oneitem['size']))
|
||||
|
||||
elif mode == 'remove':
|
||||
logger.info('[DDL-REMOVE] Successfully removed %s [%s]..' % (oneitem['series'], oneitem['size']))
|
||||
return json.dumps({'status': True, 'message': linemessage})
|
||||
ddl_requeue.exposed = True
|
||||
|
||||
def queueManage(self): # **args):
|
||||
|
|
Loading…
Add table
Reference in a new issue