NZBGet: Don't use priority when set to normal.

This commit is contained in:
Ruud
2013-01-09 23:41:47 +01:00
parent 28ce083f48
commit 0f389f18cb
2 changed files with 10 additions and 3 deletions
@@ -37,7 +37,8 @@ config = [{
'name': 'priority',
'default': '0',
'type': 'dropdown',
'values': [('Very Low', -100), ('Low', -50), ('Normal', 0), ('High', 50), ('Very High', 100)]
'values': [('Very Low', -100), ('Low', -50), ('Normal', 0), ('High', 50), ('Very High', 100)],
'description': 'Only change this if you are using NZBget 9.0 or higher',
},
{
'name': 'manual',
+8 -2
View File
@@ -1,7 +1,7 @@
from base64 import standard_b64encode
from couchpotato.core.downloaders.base import Downloader
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from inspect import isfunction
import socket
import traceback
import xmlrpclib
@@ -44,7 +44,13 @@ class NZBGet(Downloader):
log.error('Protocol Error: %s', e)
return False
if rpc.append(nzb_name, self.conf('category'), int(self.conf('priority')), False, standard_b64encode(filedata.strip())):
priority = tryInt(self.conf('priority'))
if priority != 0:
xml_response = rpc.append(nzb_name, self.conf('category'), False, standard_b64encode(filedata.strip()))
else:
xml_response = rpc.append(nzb_name, self.conf('category'), priority, False, standard_b64encode(filedata.strip()))
if xml_response:
log.info('NZB sent successfully to NZBGet')
return True
else: