Fixed filename parsing to find "AU" issues

git-svn-id: http://comictagger.googlecode.com/svn/trunk@551 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
beville@gmail.com 2013-03-27 19:20:10 +00:00
parent 2d190b076a
commit b7b8060ef2

View File

@ -112,10 +112,10 @@ class FileNameParser:
# first look for the last "#" followed by a digit in the filename. this is almost certainly the issue number
#issnum = re.search('#\d+', filename)
matchlist = re.findall("#[-+]?([0-9]*\.[0-9]+|[0-9]+)", filename)
matchlist = re.findall("#[-+]?(([0-9]*\.[0-9]+|[0-9]+)(\w*))", filename)ssss
if len(matchlist) > 0:
#get the last item
issue = matchlist[ len(matchlist) - 1]
issue = matchlist[ len(matchlist) - 1][0]
found = True
# assume the last number in the filename that is under 4 digits is the issue number
@ -134,7 +134,7 @@ class FileNameParser:
if not found:
# try a regex
issnum = re.search('(?<=[_#\s-])(\d+[a-zA-Z]|\d+\.\d|\d+)', filename)
issnum = re.search('(?<=[_#\s-])(\d+[a-zA-Z]+|\d+\.\d|\d+)', filename)
if issnum:
issue = issnum.group()
found = True