From 8a350ba2316889c9c72b698b60cd8b1af0907452 Mon Sep 17 00:00:00 2001 From: evilhero Date: Mon, 14 Jan 2019 16:54:41 -0500 Subject: [PATCH 1/2] FIX:(#2165) fix for Experimental Search not returning results --- mylar/findcomicfeed.py | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/mylar/findcomicfeed.py b/mylar/findcomicfeed.py index db45db1f..fe2e2cd0 100755 --- a/mylar/findcomicfeed.py +++ b/mylar/findcomicfeed.py @@ -50,16 +50,22 @@ def Startit(searchName, searchIssue, searchYear, ComicVersion, IssDateFix): searchName = searchName.replace("-", '((\\s)?[-:])?(\\s)?') regexName = searchName.replace(" ", '((\\s)?[-:])?(\\s)?') - if mylar.CONFIG.USE_MINSIZE: - size_constraints = "minsize=" + str(mylar.CONFIG.MINSIZE) + if mylar.CONFIG.USE_MINSIZE is True: + minsize = str(mylar.CONFIG.MINSIZE) else: - size_constraints = "minsize=10" + minsize = '10' + size_constraints = "&minsize=" + minsize - if mylar.CONFIG.USE_MAXSIZE: - size_constraints = size_constraints + "&maxsize=" + str(mylar.CONFIG.MAXSIZE) + if mylar.CONFIG.USE_MAXSIZE is True: + maxsize = str(mylar.CONFIG.MAXSIZE) + else: + maxsize = '0' + size_constraints += "&maxsize=" + maxsize - if mylar.CONFIG.USENET_RETENTION != None: - max_age = "&age=" + str(mylar.CONFIG.USENET_RETENTION) + if mylar.CONFIG.USENET_RETENTION is not None: + max_age = "&maxage=" + str(mylar.CONFIG.USENET_RETENTION) + else: + max_age = "&maxage=0" feeds = [] i = 1 @@ -72,18 +78,19 @@ def Startit(searchName, searchIssue, searchYear, ComicVersion, IssDateFix): searchmethod = '00' + searchIssue else: break - logger.fdebug('Now searching experimental for issue number: %s to try and ensure all the bases are covered' % searchmethod) + joinSearch = "+".join(splitSearch) + "+" +searchmethod + logger.fdebug('Now searching experimental for issue number: %s to try and ensure all the bases are covered' % searchmethod) + if mylar.CONFIG.PREFERRED_QUALITY == 1: joinSearch = joinSearch + " .cbr" elif mylar.CONFIG.PREFERRED_QUALITY == 2: joinSearch = joinSearch + " .cbz" - feeds.append(feedparser.parse("http://nzbindex.nl/rss/alt.binaries.comics.dcp/?sort=agedesc&" + str(size_constraints) + str(max_age) + "&dq=%s&max=50&more=1" %joinSearch)) - time.sleep(3) + feeds.append(feedparser.parse("http://beta.nzbindex.com/search/rss?q=%s&max=50&minage=0%s&hidespam=1&hidepassword=1&sort=agedesc%s&complete=0&hidecross=0&hasNFO=0&poster=&g[]=85" % (joinSearch, max_age, size_constraints))) + time.sleep(5) if mylar.CONFIG.ALTEXPERIMENTAL: - feeds.append(feedparser.parse("http://nzbindex.nl/rss/?dq=%s&g[]=41&g[]=510&sort=agedesc&hidespam=0&max=&more=1" %joinSearch)) - time.sleep(3) - + feeds.append(feedparser.parse("http://beta.nzbindex.com/search/rss?q=%s&max=50&minage=0%s&hidespam=1&hidepassword=1&sort=agedesc%s&complete=0&hidecross=0&hasNFO=0&poster=&g[]=86" % (joinSearch, max_age, size_constraints))) + time.sleep(5) i+=1 entries = [] @@ -124,7 +131,7 @@ def Startit(searchName, searchIssue, searchYear, ComicVersion, IssDateFix): regexList=[regEx, regExOne, regExTwo, regExThree, regExFour, regExFive] - except_list=['releases', 'gold line', 'distribution', '0-day', '0 day', '0day'] + except_list=['releases', 'gold line', 'distribution', '0-day', '0 day', '0day', 'o-day'] for entry in keyPair: title = entry['title'] From d2e03646d2b6e245901e6bb44b750ccf37046cec Mon Sep 17 00:00:00 2001 From: evilhero Date: Mon, 14 Jan 2019 21:52:53 -0500 Subject: [PATCH 2/2] FIX: Fix for TPB/One-Shot file rechecking expecting an issue number, but one not being present due to the type --- mylar/updater.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mylar/updater.py b/mylar/updater.py index 7a4c5adb..d63c7c22 100755 --- a/mylar/updater.py +++ b/mylar/updater.py @@ -1093,12 +1093,17 @@ def forceRescan(ComicID, archive=None, module=None, recheck=False): return else: break + if tmpfc['JusttheDigits'] is not None: temploc= tmpfc['JusttheDigits'].replace('_', ' ') temploc = re.sub('[\#\']', '', temploc) logger.fdebug('temploc: %s' % temploc) else: - temploc = None + #assume 1 if not given + if any([booktype == 'TPB', booktype == 'One-Shot']): + temploc = '1' + else: + temploc = None if all(['annual' not in temploc.lower(), 'special' not in temploc.lower()]): #remove the extension here @@ -1123,7 +1128,11 @@ def forceRescan(ComicID, archive=None, module=None, recheck=False): fnd_iss_except = 'None' - fcdigit = helpers.issuedigits(temploc) + if temploc is not None: + fcdigit = helpers.issuedigits(temploc) + elif any([booktype == 'TPB', booktype == 'One-Shot']) and temploc is None: + fcdigit = helpers.issuedigits('1') + if int(fcdigit) == int_iss: logger.fdebug(module + ' [' + str(reiss['IssueID']) + '] Issue match - fcdigit: ' + str(fcdigit) + ' ... int_iss: ' + str(int_iss))