FIX: If the actual filenames contained a vX (Version #), filechecker would ignore it

This commit is contained in:
evilhero 2013-02-20 14:34:55 -05:00
parent 04bf0af912
commit ddbd29d841
1 changed files with 9 additions and 0 deletions

View File

@ -44,6 +44,15 @@ def listFiles(dir,watchcomic,AlternateSearch=None):
subname = re.sub('[\_\#\,\/\:\;\.\-\!\$\%\&\+\'\?\@]',' ', str(subname))
modwatchcomic = re.sub('[\_\#\,\/\:\;\.\-\!\$\%\&\+\'\?\@]', ' ', str(watchcomic))
modwatchcomic = re.sub('\s+', ' ', str(modwatchcomic)).strip()
#versioning - remove it
subsplit = subname.split()
for subit in subsplit:
if 'v' in str(subit):
#print ("possible versioning detected.")
if subit[1:].isdigit():
#print (subit + " - assuming versioning. Removing from initial search pattern.")
subname = re.sub(str(subit), '', subname)
subname = re.sub('\s+', ' ', str(subname)).strip()
if AlternateSearch is not None:
altsearchcomic = re.sub('[\_\#\,\/\:\;\.\-\!\$\%\&\+\'\?\@]', ' ', str(AlternateSearch))