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

This commit is contained in:
Ruud committed 2013-01-09 23:41:47 +01:00
1 parent 28ce083f48
commit 0f389f18cb
2 files changed
+10 -3

No files matched your search

@@ -37,7 +37,8 @@ config = [{
'name': 'priority', 'name': 'priority',
'default': '0', 'default': '0',
'type': 'dropdown', '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', 'name': 'manual',
+8 -2
View File
@@ -1,7 +1,7 @@
from base64 import standard_b64encode from base64 import standard_b64encode
from couchpotato.core.downloaders.base import Downloader from couchpotato.core.downloaders.base import Downloader
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog from couchpotato.core.logger import CPLog
from inspect import isfunction
import socket import socket
import traceback import traceback
import xmlrpclib import xmlrpclib
@@ -44,7 +44,13 @@ class NZBGet(Downloader):
log.error('Protocol Error: %s', e) log.error('Protocol Error: %s', e)
return False 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') log.info('NZB sent successfully to NZBGet')
return True return True
else: else: