diff --git a/SABnzbd.py b/SABnzbd.py index 0938b85..3d7efbc 100755 --- a/SABnzbd.py +++ b/SABnzbd.py @@ -1012,7 +1012,10 @@ def main(): xlist= globber(logdir) for x in xlist: if RSS_FILE_NAME not in x: - os.remove(x) + try: + os.remove(x) + except: + pass log_new = sabnzbd.cfg.log_new() if log_new: diff --git a/interfaces/Plush/templates/static/javascripts/plush.js b/interfaces/Plush/templates/static/javascripts/plush.js index 0bab1f4..01cd321 100644 --- a/interfaces/Plush/templates/static/javascripts/plush.js +++ b/interfaces/Plush/templates/static/javascripts/plush.js @@ -562,9 +562,17 @@ jQuery(function($){ }); }); // end livequery + + $.plush.InitQueueMultiOperations(); + + }, // end $.plush.InitQueue() - // Multi-Operations + // *************************************************************** + // $.plush.InitQueueMultiOperations() - Queue Multi-Operation Events + + InitQueueMultiOperations : function() { + // selections $("#multiops_select_all").click(function(){ $("INPUT[type='checkbox']","#queueTable").attr('checked', true); @@ -594,11 +602,13 @@ jQuery(function($){ e.target.unselectable = "on"; e.target.style.MozUserSelect = "none"; }); - + + // reset ui options $('#multi_reset').click(function(){ $('#multi_status, #multi_cat, #multi_priority, #multi_pp, #multi_script').val(''); }); + // apply options - cat/priority/pp/script $('#multi_apply').click(function(){ var nzo_ids = ""; @@ -628,7 +638,7 @@ jQuery(function($){ $.ajax({ type: "POST", url: "tapi", - data: {mode: 'proc_priority', value: nzo_ids, value2: $('#multi_priority').val(), apikey: $.plush.apikey} + data: {mode:'queue', name:'priority', value: nzo_ids, value2: $('#multi_priority').val(), apikey: $.plush.apikey} }); if ($('#multi_pp').val()) @@ -649,6 +659,7 @@ jQuery(function($){ $.plush.RefreshQueue(); }); + // nzb removal $('#multi_delete').click(function(){ var nzo_ids = ""; @@ -668,8 +679,8 @@ jQuery(function($){ } }); - }, // end $.plush.InitQueue() - + }, // end $.plush.InitQueueMultiOperations() + // *************************************************************** // $.plush.InitHistory() -- History Events diff --git a/sabnzbd/interface.py b/sabnzbd/interface.py index 4e6ad0b..7e9990b 100644 --- a/sabnzbd/interface.py +++ b/sabnzbd/interface.py @@ -718,34 +718,54 @@ class MainPage: if mode == 'change_cat': if value and value2: - nzo_id = value cat = value2 if cat == 'None': cat = None - nzbqueue.change_cat(nzo_id, cat) - cat, pp, script, cat_priority = cat_to_opts(cat) + items = value.split(',') + if len(items) > 1: + for nzo_id in items: + nzbqueue.change_cat(nzo_id, cat) + cat, pp, script, cat_priority = cat_to_opts(cat) + + nzbqueue.change_script(nzo_id, script) + nzbqueue.change_opts(nzo_id, pp) + nzbqueue.set_priority(nzo_id, cat_priority) + else: + nzo_id = value + nzbqueue.change_cat(nzo_id, cat) + cat, pp, script, cat_priority = cat_to_opts(cat) - nzbqueue.change_script(nzo_id, script) - nzbqueue.change_opts(nzo_id, pp) - nzbqueue.set_priority(nzo_id, cat_priority) + nzbqueue.change_script(nzo_id, script) + nzbqueue.change_opts(nzo_id, pp) + nzbqueue.set_priority(nzo_id, cat_priority) return report(output) else: return report(output, _MSG_NO_VALUE) if mode == 'change_script': if value and value2: - nzo_id = value script = value2 if script.lower() == 'none': script = None - nzbqueue.change_script(nzo_id, script) + items = value.split(',') + if len(items) > 1: + for nzo_id in items: + nzbqueue.change_script(nzo_id, script) + else: + nzo_id = value + nzbqueue.change_script(nzo_id, script) return report(output) else: return report(output, _MSG_NO_VALUE) if mode == 'change_opts': if value and value2 and value2.isdigit(): - nzbqueue.change_opts(value, int(value2)) + items = value.split(',') + if len(items) > 1: + for nzo_id in items: + nzbqueue.change_opts(nzo_id, int(value2)) + else: + nzbqueue.change_opts(value, int(value2)) return report(output) if mode == 'fullstatus': diff --git a/sabnzbd/nzbstuff.py b/sabnzbd/nzbstuff.py index 9a98c07..873d08b 100644 --- a/sabnzbd/nzbstuff.py +++ b/sabnzbd/nzbstuff.py @@ -676,6 +676,10 @@ class NzbObject(TryList): else: accept = 1 + # Re-evaluate results from pre-queue script + self.cat, pp, self.script, self.priority = cat_to_opts(cat, pp, script, self.priority) + self.repair, self.unpack, self.delete = sabnzbd.pp_to_opts(pp) + # Pause job when above size limit if accept > 1: limit = 1 @@ -686,7 +690,6 @@ class NzbObject(TryList): self.pause() self.priority = LOW_PRIORITY - self.repair, self.unpack, self.delete = sabnzbd.pp_to_opts(pp) if reuse: self.check_existing_files(wdir)