diff --git a/mylar/filechecker.py b/mylar/filechecker.py index 5eb9cf65..58b640e8 100755 --- a/mylar/filechecker.py +++ b/mylar/filechecker.py @@ -272,6 +272,11 @@ class FileChecker(object): logger.fdebug('[SARC] Removed Reading Order sequence from subname. Now set to : %s' % modfilename) #make sure all the brackets are properly spaced apart + if modfilename.find('\s') == -1: + #if no spaces exist, assume decimals being used as spacers (ie. nzb name) + modspacer = '.' + else: + modspacer = ' ' m = re.findall('[^()]+', modfilename) cnt = 1 #2019-12-24----fixed to accomodate naming convention like Amazing Mary Jane (2019) 002.cbr, and to account for brackets properly @@ -279,10 +284,10 @@ class FileChecker(object): while cnt < len(m): #logger.fdebug('[m=%s] modfilename.find: %s' % (m[cnt], modfilename[modfilename.find('('+m[cnt]+')')+len(m[cnt])+2])) #logger.fdebug('mod_1: %s' % modfilename.find('('+m[cnt]+')')) - if modfilename[modfilename.find('('+m[cnt]+')')-1] != ' ' and modfilename.find('('+m[cnt]+')') != -1: + if modfilename[modfilename.find('('+m[cnt]+')')-1] != modspacer and modfilename.find('('+m[cnt]+')') != -1: #logger.fdebug('before_space: %s' % modfilename[modfilename.find('('+m[cnt]+')')-1]) #logger.fdebug('after_space: %s' % modfilename[modfilename.find('('+m[cnt]+')')+len(m[cnt])+2]) - modfilename = '%s%s%s' % (modfilename[:modfilename.find('('+m[cnt]+')')], ' ', modfilename[modfilename.find('('+m[cnt]+')'):]) + modfilename = '%s%s%s' % (modfilename[:modfilename.find('('+m[cnt]+')')], modspacer, modfilename[modfilename.find('('+m[cnt]+')'):]) cnt+=1 except Exception as e: #logger.warn('[ERROR] %s' % e) diff --git a/mylar/search.py b/mylar/search.py index 0c2616a6..940005b4 100755 --- a/mylar/search.py +++ b/mylar/search.py @@ -1109,7 +1109,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa logger.fdebug('Cleaned up title to : %s' % cleantitle) #send it to the parser here. - p_comic = filechecker.FileChecker(file=ComicTitle) + p_comic = filechecker.FileChecker(file=ComicTitle, watchcomic=ComicName) parsed_comic = p_comic.listFiles() logger.fdebug('parsed_info: %s' % parsed_comic) @@ -1376,18 +1376,18 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa intIss = 1000 else: intIss = 9999999999 - if parsed_comic['issue_number'] is not None: - logger.fdebug("issue we found for is : %s" % parsed_comic['issue_number']) - comintIss = helpers.issuedigits(parsed_comic['issue_number']) + if filecomic['justthedigits'] is not None: + logger.fdebug("issue we found for is : %s" % filecomic['justthedigits']) + comintIss = helpers.issuedigits(filecomic['justthedigits']) logger.fdebug("integer value of issue we have found : %s" % comintIss) else: comintIss = 11111111111 #do this so that we don't touch the actual value but just use it for comparisons - if parsed_comic['issue_number'] is None: + if filecomic['justthedigits'] is None: pc_in = None else: - pc_in = helpers.issuedigits(parsed_comic['issue_number']) + pc_in = helpers.issuedigits(filecomic['justthedigits']) #issue comparison now as well if int(intIss) == int(comintIss) or all([cmloopit == 4, findcomiciss is None, pc_in is None]) or all([cmloopit == 4, findcomiciss is None, pc_in == 1]): nowrite = False