mirror of https://github.com/evilhero/mylar
FIX: PostProcessing would fail if Meta-Tagging enabled on a Manual Run, FIX: Account for .INH issues in searches, filechecker and adding/refreshing series, FIX: Would error on weekly pull retrieval if website polled was down, FIX: In Weekly Pullist, Issues containing alphas (ie. .INH) would incorrectly be determined as just containing the numeric
This commit is contained in:
parent
4b26013400
commit
0759154e14
|
@ -589,6 +589,10 @@ class PostProcessor(object):
|
|||
|
||||
ofilename = None
|
||||
|
||||
#if meta-tagging is not enabled, we need to declare the check as being fail
|
||||
#if meta-tagging is enabled, it gets changed just below to a default of pass
|
||||
pcheck = "fail"
|
||||
|
||||
#tag the meta.
|
||||
if mylar.ENABLE_META:
|
||||
self._log("Metatagging enabled - proceeding...")
|
||||
|
@ -661,7 +665,8 @@ class PostProcessor(object):
|
|||
ofilename = filename
|
||||
path, ext = os.path.splitext(ofilename)
|
||||
else:
|
||||
otofilename = ml['ComicLocation']
|
||||
if pcheck == "fail":
|
||||
otofilename = ml['ComicLocation']
|
||||
print "otofilename:" + str(otofilename)
|
||||
odir, ofilename = os.path.split(otofilename)
|
||||
print "ofilename: " + str(ofilename)
|
||||
|
|
|
@ -323,6 +323,20 @@ def listFiles(dir,watchcomic,AlternateSearch=None,manual=None,sarc=None):
|
|||
|
||||
digitsvalid = "false"
|
||||
|
||||
for jdc in list(justthedigits):
|
||||
#logger.fdebug('jdc:' + str(jdc))
|
||||
if not jdc.isdigit():
|
||||
#logger.fdebug('alpha')
|
||||
jdc_start = justthedigits.find(jdc)
|
||||
alpha_isschk = justthedigits[jdc_start:]
|
||||
#logger.fdebug('alpha_isschk:' + str(alpha_isschk))
|
||||
for issexcept in issue_exceptions:
|
||||
if issexcept.lower() in alpha_isschk.lower() and len(alpha_isschk) <= len(issexcept):
|
||||
logger.fdebug('ALPHANUMERIC EXCEPTION : [' + justthedigits + ']')
|
||||
digitsvalid = "true"
|
||||
break
|
||||
if digitsvalid == "true": break
|
||||
|
||||
try:
|
||||
tmpthedigits = justthedigits_1.split(' ', 1)[1]
|
||||
logger.fdebug('If the series has a decimal, this should be a number [' + tmpthedigits + ']')
|
||||
|
|
|
@ -636,6 +636,8 @@ def issuedigits(issnum):
|
|||
int_issnum = (int(issnum[:-2]) * 1000) + ord('a') + ord('u')
|
||||
elif 'ai' in issnum.lower() and issnum[:1].isdigit():
|
||||
int_issnum = (int(issnum[:-2]) * 1000) + ord('a') + ord('i')
|
||||
elif 'inh' in issnum.lower():
|
||||
int_issnum = (int(issnum[:-4]) * 1000) + ord('i') + ord('n') + ord('h')
|
||||
elif u'\xbd' in issnum:
|
||||
issnum = .5
|
||||
int_issnum = int(issnum) * 1000
|
||||
|
|
|
@ -622,6 +622,8 @@ def addComictoDB(comicid,mismatch=None,pullupd=None,imported=None,ogcname=None,c
|
|||
# elif 'ai' in issnum.lower():
|
||||
# int_issnum = (int(issnum[:-2]) * 1000) + ord('a') + ord('i')
|
||||
# print "ai:" + str(int_issnum)
|
||||
elif 'inh' in issnum.lower():
|
||||
int_issnum = (int(issnum[:-4]) * 1000) + ord('i') + ord('n') + ord('h')
|
||||
elif u'\xbd' in issnum:
|
||||
issnum = .5
|
||||
int_issnum = int(issnum) * 1000
|
||||
|
@ -646,9 +648,12 @@ def addComictoDB(comicid,mismatch=None,pullupd=None,imported=None,ogcname=None,c
|
|||
if len(decis) == 1:
|
||||
decisval = int(decis) * 10
|
||||
issaftdec = str(decisval)
|
||||
if len(decis) == 2:
|
||||
elif len(decis) == 2:
|
||||
decisval = int(decis)
|
||||
issaftdec = str(decisval)
|
||||
else:
|
||||
decisval = decis
|
||||
issaftdec = str(decisval)
|
||||
try:
|
||||
# int_issnum = str(issnum)
|
||||
int_issnum = (int(issb4dec) * 1000) + (int(issaftdec) * 10)
|
||||
|
|
|
@ -468,14 +468,21 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
|||
c_number = None
|
||||
c_num_a4 = None
|
||||
while i < len(findcomiciss):
|
||||
#print findcomiciss[i]
|
||||
#take first occurance of alpha in string and carry it through
|
||||
if findcomiciss[i].isalpha():
|
||||
#print 'alpha detected'
|
||||
c_alpha = findcomiciss[i:].rstrip()
|
||||
c_number = findcomiciss[:i].rstrip()
|
||||
break
|
||||
elif '.' in findcomiciss[i]:
|
||||
c_number = findcomiciss[i:].rstrip()
|
||||
c_num_a4 = findcomiciss[:i+1].rstrip()
|
||||
#print 'decimal detected'
|
||||
c_number = findcomiciss[:i].rstrip()
|
||||
c_num_a4 = findcomiciss[i+1:].rstrip()
|
||||
if c_num_a4.isalpha():
|
||||
c_alpha = c_num_a4
|
||||
else:
|
||||
c_number = str(cnumber) + str(c_num_a4)
|
||||
break
|
||||
i+=1
|
||||
logger.fdebug("calpha/cnumber: " + str(c_alpha) + " / " + str(c_number))
|
||||
|
|
|
@ -111,6 +111,12 @@ def pullit(forcecheck=None):
|
|||
newfl = mylar.CACHE_DIR + "/Clean-newreleases.txt"
|
||||
newtxtfile = open(newfl, 'wb')
|
||||
|
||||
if check(newrl, 'Service Unavailable'):
|
||||
logger.info('Retrieval site is offline at the moment.Aborting pull-list update amd will try again later.')
|
||||
pullitcheck(forcecheck=forcecheck)
|
||||
else:
|
||||
pass
|
||||
|
||||
for i in open(newrl):
|
||||
if not i.strip():
|
||||
continue
|
||||
|
@ -182,7 +188,7 @@ def pullit(forcecheck=None):
|
|||
dupefound = "no"
|
||||
if '#' in i:
|
||||
issname = i.split()
|
||||
#print (issname)
|
||||
print (issname)
|
||||
issnamec = len(issname)
|
||||
n = 0
|
||||
while (n < issnamec):
|
||||
|
@ -222,10 +228,11 @@ def pullit(forcecheck=None):
|
|||
#print ("pub: " + str(pub))
|
||||
#print ("issue: " + str(issue))
|
||||
#--let's make sure we don't wipe out decimal issues ;)
|
||||
if '.' in issue:
|
||||
issue_decimal = re.compile(r'[^\d.]+')
|
||||
issue = issue_decimal.sub('', str(issue))
|
||||
else: issue = re.sub('#','', issue)
|
||||
# if '.' in issue:
|
||||
# issue_decimal = re.compile(r'[^\d.]+')
|
||||
# issue = issue_decimal.sub('', str(issue))
|
||||
# else: issue = re.sub('#','', issue)
|
||||
issue = re.sub('#','', issue)
|
||||
#issue = re.sub("\D", "", str(issue))
|
||||
#store the previous comic/issue for comparison to filter out duplicate issues/alt covers
|
||||
#print ("Previous Comic & Issue: " + str(prevcomic) + "--" + str(previssue))
|
||||
|
@ -234,7 +241,7 @@ def pullit(forcecheck=None):
|
|||
#if it doesn't have a '#' in the line, then we know it's either
|
||||
#a special edition of some kind, or a non-comic
|
||||
issname = i.split()
|
||||
#print (issname)
|
||||
print (issname)
|
||||
issnamec = len(issname)
|
||||
n = 1
|
||||
issue = ''
|
||||
|
@ -593,3 +600,8 @@ def pullitcheck(comic1off_name=None,comic1off_id=None,forcecheck=None, futurepul
|
|||
logger.info(u"Finished checking for comics on my watchlist.")
|
||||
#con.close()
|
||||
return
|
||||
|
||||
|
||||
def check(fname, txt):
|
||||
with open(fname) as dataf:
|
||||
return any(txt in line for line in dataf)
|
||||
|
|
Loading…
Reference in New Issue