|
|
@ -67,7 +67,7 @@ class NZBGet(Downloader): |
|
|
|
log.error('NZBGet could not add %s to the queue.', nzb_name) |
|
|
|
return False |
|
|
|
|
|
|
|
def getAllDownloadStatus(self): |
|
|
|
def getAllDownloadStatus(self, ids): |
|
|
|
|
|
|
|
log.debug('Checking NZBGet download status.') |
|
|
|
|
|
|
@ -102,13 +102,13 @@ class NZBGet(Downloader): |
|
|
|
release_downloads = ReleaseDownloadList(self) |
|
|
|
|
|
|
|
for nzb in groups: |
|
|
|
log.debug('Found %s in NZBGet download queue', nzb['NZBFilename']) |
|
|
|
try: |
|
|
|
nzb_id = [param['Value'] for param in nzb['Parameters'] if param['Name'] == 'couchpotato'][0] |
|
|
|
except: |
|
|
|
nzb_id = nzb['NZBID'] |
|
|
|
|
|
|
|
|
|
|
|
if nzb_id in ids: |
|
|
|
log.debug('Found %s in NZBGet download queue', nzb['NZBFilename']) |
|
|
|
timeleft = -1 |
|
|
|
try: |
|
|
|
if nzb['ActiveDownloads'] > 0 and nzb['DownloadRate'] > 0 and not (status['DownloadPaused'] or status['Download2Paused']): |
|
|
@ -125,6 +125,7 @@ class NZBGet(Downloader): |
|
|
|
}) |
|
|
|
|
|
|
|
for nzb in queue: # 'Parameters' is not passed in rpc.postqueue |
|
|
|
if nzb['NZBID'] in ids: |
|
|
|
log.debug('Found %s in NZBGet postprocessing queue', nzb['NZBFilename']) |
|
|
|
release_downloads.append({ |
|
|
|
'id': nzb['NZBID'], |
|
|
@ -134,11 +135,13 @@ class NZBGet(Downloader): |
|
|
|
}) |
|
|
|
|
|
|
|
for nzb in history: |
|
|
|
log.debug('Found %s in NZBGet history. ParStatus: %s, ScriptStatus: %s, Log: %s', (nzb['NZBFilename'] , nzb['ParStatus'], nzb['ScriptStatus'] , nzb['Log'])) |
|
|
|
try: |
|
|
|
nzb_id = [param['Value'] for param in nzb['Parameters'] if param['Name'] == 'couchpotato'][0] |
|
|
|
except: |
|
|
|
nzb_id = nzb['NZBID'] |
|
|
|
|
|
|
|
if nzb_id in ids: |
|
|
|
log.debug('Found %s in NZBGet history. ParStatus: %s, ScriptStatus: %s, Log: %s', (nzb['NZBFilename'] , nzb['ParStatus'], nzb['ScriptStatus'] , nzb['Log'])) |
|
|
|
release_downloads.append({ |
|
|
|
'id': nzb_id, |
|
|
|
'name': nzb['NZBFilename'], |
|
|
|