1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2024-12-27 01:57:01 +00:00

FIX:(#912) Unable to add series that have issue numbers containing 'O' and 'X'. Also updated file checking to include the same fix.

This commit is contained in:
evilhero 2015-01-01 19:58:31 -05:00
parent 7e6a0e648a
commit 054b7cf3aa
3 changed files with 14 additions and 4 deletions

View file

@ -67,7 +67,8 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non
'A', 'A',
'B', 'B',
'C', 'C',
'X'] 'X',
'O']
extensions = ('.cbr', '.cbz', '.cb7') extensions = ('.cbr', '.cbz', '.cb7')

View file

@ -769,7 +769,12 @@ def cleanhtml(raw_html):
def issuedigits(issnum): def issuedigits(issnum):
import db, logger import db, logger
#print "issnum : " + str(issnum)
try:
tst = issnum.isdigit()
except:
return 9999999999
if issnum.isdigit(): if issnum.isdigit():
int_issnum = int( issnum ) * 1000 int_issnum = int( issnum ) * 1000
else: else:
@ -849,13 +854,15 @@ def issuedigits(issnum):
if issnum[x].isalpha(): if issnum[x].isalpha():
#take first occurance of alpha in string and carry it through #take first occurance of alpha in string and carry it through
tstord = issnum[x:].rstrip() tstord = issnum[x:].rstrip()
tstord = re.sub('[\-\,\.\+]','', tstord).rstrip()
issno = issnum[:x].rstrip() issno = issnum[:x].rstrip()
issno = re.sub('[\-\,\.\+]','', issno).rstrip()
try: try:
isschk = float(issno) isschk = float(issno)
except ValueError, e: except ValueError, e:
if len(issnum) == 1 and issnum.isalpha(): if len(issnum) == 1 and issnum.isalpha():
break break
logger.fdebug('invalid numeric for issue - cannot be found. Ignoring.') logger.fdebug('[' + issno + '] Invalid numeric for issue - cannot be found. Ignoring.')
issno = None issno = None
tstord = None tstord = None
invchk = "true" invchk = "true"

View file

@ -1192,14 +1192,16 @@ def updateissuedata(comicid, comicname=None, issued=None, comicIssues=None, call
if issnum[x].isalpha(): if issnum[x].isalpha():
#take first occurance of alpha in string and carry it through #take first occurance of alpha in string and carry it through
tstord = issnum[x:].rstrip() tstord = issnum[x:].rstrip()
tstord = re.sub('[\-\,\.\+]','', tstord).rstrip()
issno = issnum[:x].rstrip() issno = issnum[:x].rstrip()
issno = re.sub('[\-\,\.\+]','', issno).rstrip()
try: try:
isschk = float(issno) isschk = float(issno)
except ValueError, e: except ValueError, e:
if len(issnum) == 1 and issnum.isalpha(): if len(issnum) == 1 and issnum.isalpha():
logger.fdebug('detected lone alpha issue. Attempting to figure this out.') logger.fdebug('detected lone alpha issue. Attempting to figure this out.')
break break
logger.fdebug('invalid numeric for issue - cannot be found. Ignoring.') logger.fdebug('[' + issno + '] Invalid numeric for issue - cannot be found. Ignoring.')
issno = None issno = None
tstord = None tstord = None
invchk = "true" invchk = "true"