From 15955c53794dce6cfab511f5fde27ffb46dacb56 Mon Sep 17 00:00:00 2001 From: evilhero Date: Fri, 15 Feb 2019 19:40:48 -0500 Subject: [PATCH 1/3] FIX:(#2203) Fix for one-off downloads taking source location as final destination when metatagging was not enabled --- mylar/PostProcessor.py | 8 ++++++-- mylar/nzbget.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mylar/PostProcessor.py b/mylar/PostProcessor.py index de9dfc4e..0f6234a8 100755 --- a/mylar/PostProcessor.py +++ b/mylar/PostProcessor.py @@ -1836,7 +1836,7 @@ class PostProcessor(object): renamed_file = helpers.rename_param(comicid, comicname, issuenumber, dfilename, issueid=issueid, arc=sarc) if renamed_file: dfilename = renamed_file['nfilename'] - logger.fdebug('%s Renaming file to conform to configuration: %s' % (module, ofilename)) + logger.fdebug('%s Renaming file to conform to configuration: %s' % (module, dfilename)) if sandwich is not None and 'S' in sandwich: #if from a StoryArc, check to see if we're appending the ReadingOrder to the filename @@ -1850,7 +1850,11 @@ class PostProcessor(object): dfilename = ofilename grab_dst = os.path.join(grdst, dfilename) else: - grab_dst = os.path.join(grdst, ofilename) + grab_dst = os.path.join(grdst, dfilename) + + if not os.path.exists(grab_dst) or grab_src == grab_dst: + #if it hits this, ofilename is the full path so we need to extract just the filename to path it back to a possible grab_bag dir + grab_dst = os.path.join(grdst, os.path.split(dfilename)[1]) self._log("Destination Path : %s" % grab_dst) diff --git a/mylar/nzbget.py b/mylar/nzbget.py index 01fa73eb..714cb944 100644 --- a/mylar/nzbget.py +++ b/mylar/nzbget.py @@ -168,7 +168,7 @@ class NZBGet(object): found = False destdir = None double_pp = False - hq = [hs for hs in history if hs['NZBID'] == nzbid and ('SUCCESS' in hs['Status'] or ('COPY' in hs['Status'] and 'DELETED' not in hq[0]['Status']))] + hq = [hs for hs in history if hs['NZBID'] == nzbid and ('SUCCESS' in hs['Status'] or ('COPY' in hs['Status']))] if len(hq) > 0: logger.fdebug('found matching completed item in history. Job has a status of %s' % hq[0]['Status']) if len(hq[0]['ScriptStatuses']) > 0: From 77a2cecbaa57213b35ed9000b95cf38cfc881ab2 Mon Sep 17 00:00:00 2001 From: evilhero Date: Sun, 17 Feb 2019 12:12:13 -0500 Subject: [PATCH 2/3] FIX: weekly error due to typo --- mylar/weeklypull.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mylar/weeklypull.py b/mylar/weeklypull.py index 435be313..0d754ed8 100755 --- a/mylar/weeklypull.py +++ b/mylar/weeklypull.py @@ -81,7 +81,7 @@ def pullit(forcecheck=None, weeknumber=None, year=None): elif chk_locg['status'] == 'success': logger.info('[PULL-LIST] Weekly Pull List successfully loaded with ' + str(chk_locg['count']) + ' issues.') return new_pullcheck(chk_locg['weeknumber'],chk_locg['year']) - elif chk_log['status'] == 'update_required': + elif chk_locg['status'] == 'update_required': logger.warn('[PULL-LIST] Your version of Mylar is not up-to-date. You MUST update before this works') return else: From 47477eea26a28b4a5db87a16e0dd0d0a5d3f8213 Mon Sep 17 00:00:00 2001 From: evilhero Date: Tue, 19 Feb 2019 10:46:55 -0500 Subject: [PATCH 3/3] FIX: fix for DDL not performing timestamp comparison properly due to change --- mylar/search.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mylar/search.py b/mylar/search.py index c4ba1b91..d923395a 100755 --- a/mylar/search.py +++ b/mylar/search.py @@ -987,7 +987,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa logger.fdebug('date used is : %s' % stdate) postdate_int = None - if all([nzbprov == '32P', RSS == 'no']) or nzbprov == 'ddl': + if all([nzbprov == '32P', RSS == 'no']) or all([nzbprov == 'ddl', len(pubdate) == 10]): postdate_int = pubdate logger.fdebug('[%s] postdate_int: %s' % (nzbprov, postdate_int)) elif any([postdate_int is None, type(postdate_int) != int]) or not all([nzbprov == '32P', RSS == 'no']): @@ -1069,11 +1069,11 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa if digitaldate != '0000-00-00' and dateconv2.date() >= digconv2.date(): logger.fdebug('%s is after DIGITAL store date of %s' % (pubdate, digitaldate)) elif dateconv2.date() < issconv2.date(): - logger.fdebug('[CONV]pubdate: %s < storedate: %s' % (dateconv2.date(), issconv2.date())) + logger.fdebug('[CONV] pubdate: %s < storedate: %s' % (dateconv2.date(), issconv2.date())) logger.fdebug('%s is before store date of %s. Ignoring search result as this is not the right issue.' % (pubdate, stdate)) continue else: - logger.fdebug('%s is after store date of %s' % (pubdate, stdate)) + logger.fdebug('[CONV] %s is after store date of %s' % (pubdate, stdate)) except: #if the above fails, drop down to the integer compare method as a failsafe. if digitaldate != '0000-00-00' and postdate_int >= digitaldate_int: @@ -1083,9 +1083,8 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa logger.fdebug('%s is before store date of %s. Ignoring search result as this is not the right issue.' % (pubdate, stdate)) continue else: - logger.fdebug('%s is after store date of %s' % (pubdate, stdate)) + logger.fdebug('[INT] %s is after store date of %s' % (pubdate, stdate)) # -- end size constaints. - if '(digital first)' in ComicTitle.lower(): #entry['title'].lower(): dig_moving = re.sub('\(digital first\)', '', ComicTitle.lower()).strip() #entry['title'].lower()).strip() dig_moving = re.sub('[\s+]', ' ', dig_moving)