From 59ae20278904f422f6b99b7b171648fa32db10e4 Mon Sep 17 00:00:00 2001 From: evilhero Date: Thu, 21 Feb 2019 13:56:21 -0500 Subject: [PATCH] FIX: Fix for CDH looping endlessly when failing to locate item in downloader client history --- mylar/helpers.py | 4 +++- mylar/nzbget.py | 2 +- mylar/sabnzbd.py | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mylar/helpers.py b/mylar/helpers.py index 979be5fe..c593c3d2 100755 --- a/mylar/helpers.py +++ b/mylar/helpers.py @@ -3171,7 +3171,9 @@ def nzb_monitor(queue): logger.warn('There are no NZB Completed Download handlers enabled. Not sending item to completed download handling...') break - if nzstat['status'] is False: + if any([nzstat['status'] == 'file not found', nzstat['status'] == 'double-pp']): + logger.warn('Unable to complete post-processing call due to not finding file in the location provided. [%s]' % item) + elif nzstat['status'] is False: logger.info('Could not find NZBID %s in the downloader\'s queue. I will requeue this item for post-processing...' % item['NZBID']) time.sleep(5) mylar.NZB_QUEUE.put(item) diff --git a/mylar/nzbget.py b/mylar/nzbget.py index 714cb944..e76d8df4 100644 --- a/mylar/nzbget.py +++ b/mylar/nzbget.py @@ -212,7 +212,7 @@ class NZBGet(object): logger.fdebug('NZBGET Destination dir set to: %s' % destdir) else: logger.warn('no file found where it should be @ %s - is there another script that moves things after completion ?' % hq[0]['DestDir']) - return {'status': False} + return {'status': 'file not found', 'failed': False} if mylar.CONFIG.NZBGET_DIRECTORY is not None: destdir2 = mylar.CONFIG.NZBGET_DIRECTORY diff --git a/mylar/sabnzbd.py b/mylar/sabnzbd.py index c330e81c..5cf3fbe9 100644 --- a/mylar/sabnzbd.py +++ b/mylar/sabnzbd.py @@ -136,7 +136,8 @@ class SABnzbd(object): break else: logger.info('no file found where it should be @ %s - is there another script that moves things after completion ?' % hq['storage']) - break + return {'status': 'file not found', 'failed': False} + elif hq['nzo_id'] == sendresponse and hq['status'] == 'Failed': #get the stage / error message and see what we can do stage = hq['stage_log'] @@ -160,6 +161,6 @@ class SABnzbd(object): except Exception as e: logger.warn('error %s' % e) - break + return {'status': False, 'failed': False} return found