FIX: When adding TPB/GN series that collects other TPB series, would incorrectly attempt to find an issue number resulting in an error

This commit is contained in:
evilhero 2019-01-23 13:12:54 -05:00
parent f53ad0fe71
commit 0cfe3e22e0
1 changed files with 24 additions and 14 deletions

View File

@ -374,8 +374,10 @@ def GetComicInfo(comicid, dom, safechk=None):
#if it's point form bullets, ignore it cause it's not the current volume stuff. #if it's point form bullets, ignore it cause it's not the current volume stuff.
test_it = desc_soup.find('ul') test_it = desc_soup.find('ul')
if test_it: if test_it:
for x in test_it.findAll('a'): for x in test_it.findAll('li'):
micdrop.append(x['data-ref-id']) if any(['Next' in x.findNext(text=True), 'Previous' in x.findNext(text=True)]):
mic_check = x.find('a')
micdrop.append(mic_check['data-ref-id'])
for fc in desclinks: for fc in desclinks:
#logger.info('fc: %s' % fc) #logger.info('fc: %s' % fc)
@ -394,17 +396,24 @@ def GetComicInfo(comicid, dom, safechk=None):
fc_cid = fc_id fc_cid = fc_id
fc_isid = None fc_isid = None
issuerun = fc.next_sibling issuerun = fc.next_sibling
lines = re.sub("[^0-9]", ' ', issuerun).strip().split(' ') if issuerun is not None:
if len(lines) > 0: lines = re.sub("[^0-9]", ' ', issuerun).strip().split(' ')
for x in sorted(lines, reverse=True): if len(lines) > 0:
srchline = issuerun.rfind(x) for x in sorted(lines, reverse=True):
if srchline != -1: srchline = issuerun.rfind(x)
try: if srchline != -1:
if issuerun[srchline+len(x)] == ',' or issuerun[srchline+len(x)] == '.' or issuerun[srchline+len(x)] == ' ': try:
issuerun = issuerun[:srchline+len(x)] if issuerun[srchline+len(x)] == ',' or issuerun[srchline+len(x)] == '.' or issuerun[srchline+len(x)] == ' ':
break issuerun = issuerun[:srchline+len(x)]
except: break
continue except Exception as e:
logger.warn('[ERROR] %s' % e)
continue
else:
iss_start = fc_name.find('#')
issuerun = fc_name[iss_start:].strip()
fc_name = fc_name[:iss_start].strip()
if issuerun.endswith('.') or issuerun.endswith(','): if issuerun.endswith('.') or issuerun.endswith(','):
#logger.fdebug('Changed issuerun from %s to %s' % (issuerun, issuerun[:-1])) #logger.fdebug('Changed issuerun from %s to %s' % (issuerun, issuerun[:-1]))
issuerun = issuerun[:-1] issuerun = issuerun[:-1]
@ -412,7 +421,8 @@ def GetComicInfo(comicid, dom, safechk=None):
issuerun = issuerun[:-4].strip() issuerun = issuerun[:-4].strip()
elif issuerun.endswith(' and'): elif issuerun.endswith(' and'):
issuerun = issuerun[:-3].strip() issuerun = issuerun[:-3].strip()
else:
continue
# except: # except:
# pass # pass
issue_list.append({'series': fc_name, issue_list.append({'series': fc_name,