Private GIT

Skip to content
Snippets Groups Projects
Commit 0f389f18 authored by Ruud's avatar Ruud
Browse files

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

parent 28ce083f
No related branches found
No related tags found
No related merge requests found
......@@ -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',
......
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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment