mirror of
https://github.com/evilhero/mylar
synced 2025-01-03 05:24:43 +00:00
FIX:(#2405) When searching annuals would incorrectly grab the wrong issue under certain conditions, FIX: fixed the issue number detection when parsing nzb results due to the use of decimal places as spacers being used by some providers
This commit is contained in:
parent
6ffb938735
commit
931cbed1c6
2 changed files with 13 additions and 8 deletions
|
@ -272,6 +272,11 @@ class FileChecker(object):
|
||||||
logger.fdebug('[SARC] Removed Reading Order sequence from subname. Now set to : %s' % modfilename)
|
logger.fdebug('[SARC] Removed Reading Order sequence from subname. Now set to : %s' % modfilename)
|
||||||
|
|
||||||
#make sure all the brackets are properly spaced apart
|
#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)
|
m = re.findall('[^()]+', modfilename)
|
||||||
cnt = 1
|
cnt = 1
|
||||||
#2019-12-24----fixed to accomodate naming convention like Amazing Mary Jane (2019) 002.cbr, and to account for brackets properly
|
#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):
|
while cnt < len(m):
|
||||||
#logger.fdebug('[m=%s] modfilename.find: %s' % (m[cnt], modfilename[modfilename.find('('+m[cnt]+')')+len(m[cnt])+2]))
|
#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]+')'))
|
#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('before_space: %s' % modfilename[modfilename.find('('+m[cnt]+')')-1])
|
||||||
#logger.fdebug('after_space: %s' % modfilename[modfilename.find('('+m[cnt]+')')+len(m[cnt])+2])
|
#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
|
cnt+=1
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
#logger.warn('[ERROR] %s' % e)
|
#logger.warn('[ERROR] %s' % e)
|
||||||
|
|
|
@ -1109,7 +1109,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
|
||||||
logger.fdebug('Cleaned up title to : %s' % cleantitle)
|
logger.fdebug('Cleaned up title to : %s' % cleantitle)
|
||||||
|
|
||||||
#send it to the parser here.
|
#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()
|
parsed_comic = p_comic.listFiles()
|
||||||
|
|
||||||
logger.fdebug('parsed_info: %s' % parsed_comic)
|
logger.fdebug('parsed_info: %s' % parsed_comic)
|
||||||
|
@ -1376,18 +1376,18 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
|
||||||
intIss = 1000
|
intIss = 1000
|
||||||
else:
|
else:
|
||||||
intIss = 9999999999
|
intIss = 9999999999
|
||||||
if parsed_comic['issue_number'] is not None:
|
if filecomic['justthedigits'] is not None:
|
||||||
logger.fdebug("issue we found for is : %s" % parsed_comic['issue_number'])
|
logger.fdebug("issue we found for is : %s" % filecomic['justthedigits'])
|
||||||
comintIss = helpers.issuedigits(parsed_comic['issue_number'])
|
comintIss = helpers.issuedigits(filecomic['justthedigits'])
|
||||||
logger.fdebug("integer value of issue we have found : %s" % comintIss)
|
logger.fdebug("integer value of issue we have found : %s" % comintIss)
|
||||||
else:
|
else:
|
||||||
comintIss = 11111111111
|
comintIss = 11111111111
|
||||||
|
|
||||||
#do this so that we don't touch the actual value but just use it for comparisons
|
#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
|
pc_in = None
|
||||||
else:
|
else:
|
||||||
pc_in = helpers.issuedigits(parsed_comic['issue_number'])
|
pc_in = helpers.issuedigits(filecomic['justthedigits'])
|
||||||
#issue comparison now as well
|
#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]):
|
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
|
nowrite = False
|
||||||
|
|
Loading…
Reference in a new issue