From 1a625d14187d7b210bda10eee4582eb87879836d Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Sun, 20 Jul 2014 13:44:54 +0200 Subject: [PATCH] Added Support for new append method of NZBGet 13+ --- sickbeard/nzbget.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sickbeard/nzbget.py b/sickbeard/nzbget.py index ad73515d..8646c0ca 100644 --- a/sickbeard/nzbget.py +++ b/sickbeard/nzbget.py @@ -112,13 +112,20 @@ def sendNZB(nzb, proper=False): return False nzbcontent64 = standard_b64encode(data) nzbget_result = nzbGetRPC.append(nzb.name + ".nzb", sickbeard.NZBGET_CATEGORY, addToTop, nzbcontent64) - elif nzbget_version >= 12: + elif nzbget_version == 12: if nzbcontent64 is not None: nzbget_result = nzbGetRPC.append(nzb.name + ".nzb", sickbeard.NZBGET_CATEGORY, nzbgetprio, False, nzbcontent64, False, dupekey, dupescore, "score") else: nzbget_result = nzbGetRPC.appendurl(nzb.name + ".nzb", sickbeard.NZBGET_CATEGORY, nzbgetprio, False, nzb.url, False, dupekey, dupescore, "score") + # v13+ has a new combined append method that accepts both (url and content) + # also the return value has changed from boolean to integer + # (Positive number representing NZBID of the queue item. 0 and negative numbers represent error codes.) + elif nzbget_version >= 13: + nzbget_result = True if nzbGetRPC.append(nzb.name + ".nzb", nzbcontent64 if nzbcontent64 is not None else nzb.url, + sickbeard.NZBGET_CATEGORY, nzbgetprio, False, False, dupekey, dupescore, + "score") > 0 else False else: if nzbcontent64 is not None: nzbget_result = nzbGetRPC.append(nzb.name + ".nzb", sickbeard.NZBGET_CATEGORY, nzbgetprio, False,