1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2024-12-25 09:11:46 +00:00

FIX:(#792) If filename had issue # that was 19xx-20xx it would not scan in properly, FIX:(#793) If filename had decimals in series title, would not scan in

This commit is contained in:
evilhero 2014-08-18 15:48:43 -04:00
parent e6968ee2e6
commit 5a481dbbc7

View file

@ -250,11 +250,15 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non
else:
if numberinseries == 'True' or decimalinseries == 'True':
#we need to remove the series from the subname and then search the remainder.
watchname = re.sub('[\:\;\!\'\/\?\+\=\_\%\.\-]', '', watchcomic) #remove spec chars for watchcomic match.
logger.fdebug('[FILECHECKER] watch-cleaned: ' + watchname)
subthis = re.sub('.cbr', '', subname)
subthis = re.sub('.cbz', '', subthis)
subthis = re.sub('[\:\;\!\'\/\?\+\=\_\%\.\-]', '', subthis)
if decimalinseries == 'True':
watchname = re.sub('[\:\;\!\'\/\?\+\=\_\%\-]', '', watchcomic) #remove spec chars for watchcomic match.
subthis = re.sub('[\:\;\!\'\/\?\+\=\_\%\-]', '', subthis)
else:
watchname = re.sub('[\:\;\!\'\/\?\+\=\_\%\.\-]', '', watchcomic) #remove spec chars for watchcomic match.
subthis = re.sub('[\:\;\!\'\/\?\+\=\_\%\.\-]', '', subthis)
logger.fdebug('[FILECHECKER] watch-cleaned: ' + watchname)
subthis = re.sub('\s+',' ', subthis)
logger.fdebug('[FILECHECKER] sub-cleaned: ' + subthis)
#we need to make sure the file is part of the correct series or else will match falsely
@ -276,7 +280,11 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non
logger.fdebug('[FILECHECKER] Flipping the issue with the year: ' + str(subname))
break
else:
subname = re.sub('(19\d{2}|20\d{2})(.*)', '\\2 (\\1)', subthis)
numcheck = re.findall('[19\d{2}|20\d{2}]', subthis)
if len(numcheck) == 1:
subname = re.sub('(19\d{2}|20\d{2})(.*)', '\\2 (\\1)', subthis)
else:
subname = re.sub('(19\d{2}|20\d{2})(.*)', '\\1 (\\2)', subthis)
subname = re.sub('\(\)', '', subname).strip()
subname = watchname + ' ' + subname