mirror of
https://github.com/evilhero/mylar
synced 2024-12-22 15:52:47 +00:00
FIX: decimal issues weren't being searched properly and giving errors
This commit is contained in:
parent
0759154e14
commit
c93386586a
1 changed files with 8 additions and 7 deletions
|
@ -465,27 +465,28 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
||||||
#determine the amount of loops here
|
#determine the amount of loops here
|
||||||
i = 0
|
i = 0
|
||||||
c_alpha = None
|
c_alpha = None
|
||||||
|
dsp_c_alpha = None
|
||||||
c_number = None
|
c_number = None
|
||||||
c_num_a4 = None
|
c_num_a4 = None
|
||||||
while i < len(findcomiciss):
|
while i < len(findcomiciss):
|
||||||
#print findcomiciss[i]
|
|
||||||
#take first occurance of alpha in string and carry it through
|
#take first occurance of alpha in string and carry it through
|
||||||
if findcomiciss[i].isalpha():
|
if findcomiciss[i].isalpha():
|
||||||
#print 'alpha detected'
|
|
||||||
c_alpha = findcomiciss[i:].rstrip()
|
c_alpha = findcomiciss[i:].rstrip()
|
||||||
c_number = findcomiciss[:i].rstrip()
|
c_number = findcomiciss[:i].rstrip()
|
||||||
break
|
break
|
||||||
elif '.' in findcomiciss[i]:
|
elif '.' in findcomiciss[i]:
|
||||||
#print 'decimal detected'
|
|
||||||
c_number = findcomiciss[:i].rstrip()
|
c_number = findcomiciss[:i].rstrip()
|
||||||
c_num_a4 = findcomiciss[i+1:].rstrip()
|
c_num_a4 = findcomiciss[i+1:].rstrip()
|
||||||
if c_num_a4.isalpha():
|
#if decimal seperates numeric from alpha (ie - 7.INH)
|
||||||
c_alpha = c_num_a4
|
#don't give calpha a value or else will seperate with a space further down
|
||||||
|
#assign it to dsp_c_alpha so that it can be displayed for debugging.
|
||||||
|
if not c_num_a4.isdigit():
|
||||||
|
dsp_c_alpha = c_num_a4
|
||||||
else:
|
else:
|
||||||
c_number = str(cnumber) + str(c_num_a4)
|
c_number = str(c_number) + '.' + str(c_num_a4)
|
||||||
break
|
break
|
||||||
i+=1
|
i+=1
|
||||||
logger.fdebug("calpha/cnumber: " + str(c_alpha) + " / " + str(c_number))
|
logger.fdebug("calpha/cnumber: " + str(dsp_c_alpha) + " / " + str(c_number))
|
||||||
|
|
||||||
if c_number is None:
|
if c_number is None:
|
||||||
c_number = findcomiciss # if it's None, means no special alphas or decimals
|
c_number = findcomiciss # if it's None, means no special alphas or decimals
|
||||||
|
|
Loading…
Reference in a new issue