Handle case of non-exisiting issue string
git-svn-id: http://comictagger.googlecode.com/svn/trunk@316 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
parent
97dc36b8fb
commit
0cd10f3f75
@ -183,7 +183,9 @@ class ComicVineTalker(QObject):
|
||||
volume_results = self.fetchVolumeData( series_id )
|
||||
|
||||
found = False
|
||||
for record in volume_results['issues']:
|
||||
for record in volume_results['issues']:
|
||||
if IssueString(issue_number).asFloat() is None:
|
||||
issue_number = 1
|
||||
if float(record['issue_number']) == float(issue_number):
|
||||
found = True
|
||||
break
|
||||
|
@ -33,6 +33,12 @@ import re
|
||||
|
||||
class IssueString:
|
||||
def __init__(self, text):
|
||||
|
||||
if text is None:
|
||||
self.num = None
|
||||
self.suffix = ""
|
||||
return
|
||||
|
||||
self.text = str(text)
|
||||
#strip out non float-y stuff
|
||||
tmp_num_str = re.sub('[^0-9.-]',"", self.text )
|
||||
|
Loading…
x
Reference in New Issue
Block a user