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

FIX:(#480) A/B Lettering in issue numbering fails, FIX:(#476) Unwritten counting .5 issues messes up, FIX:(#484) Checking weekly releases throws execption if annuals off and annual encountered in weeklypull, FIX:(#479)(#481) Update would fail on RSS Check / Starup error

This commit is contained in:
evilhero 2013-07-31 02:34:07 -04:00
parent 39c2817c35
commit 16ddfad398
4 changed files with 59 additions and 12 deletions

View file

@ -651,7 +651,7 @@ def issuedigits(issnum):
decisval = int(decis) decisval = int(decis)
issaftdec = str(decisval) issaftdec = str(decisval)
try: try:
int_issnum = (int(issb4dec) * 1000) + (int(issaftdec) * 100) int_issnum = (int(issb4dec) * 1000) + (int(issaftdec) * 10)
except ValueError: except ValueError:
logger.error("This has no issue #'s for me to get - Either a Graphic Novel or one-shot.") logger.error("This has no issue #'s for me to get - Either a Graphic Novel or one-shot.")
int_issnum = 999999999999999 int_issnum = 999999999999999
@ -664,8 +664,30 @@ def issuedigits(issnum):
int_issnum = (int(x)*1000) - 1 int_issnum = (int(x)*1000) - 1
else: raise ValueError else: raise ValueError
except ValueError, e: except ValueError, e:
#logger.error(str(issnum) + "this has an alpha-numeric in the issue # which I cannot account for.") #this will account for any alpha in a issue#, so long as it doesn't have decimals.
int_issnum = 999999999999999 x = 0
tstord = 0
issno = 0
while (x < len(issnum)):
if issnum[x].isalpha():
#take first occurance of alpha in string and carry it through
tstord = issnum[x:]
issno = issnum[:x]
break
x+=1
if tstord is not None and issno is not None:
logger.fdebug("tstord: " + str(tstord))
a = 0
ordtot = 0
while (a < len(tstord)):
ordtot += ord(tstord[a].lower()) #lower-case the letters for simplicty
a+=1
logger.fdebug("issno: " + str(issno))
int_issnum = (int(issno) * 1000) + ordtot
logger.fdebug("intissnum : " + str(int_issnum))
else:
logger.error(str(issnum) + "this has an alpha-numeric in the issue # which I cannot account for.")
int_issnum = 999999999999999
return int_issnum return int_issnum

View file

@ -305,9 +305,9 @@ def addComictoDB(comicid,mismatch=None,pullupd=None,imported=None,ogcname=None):
#print helpers.replace_all(mylar.FOLDER_FORMAT, values) #print helpers.replace_all(mylar.FOLDER_FORMAT, values)
if mylar.FOLDER_FORMAT == '': if mylar.FOLDER_FORMAT == '':
comlocation = mylar.DESTINATION_DIR + "/" + comicdir + " (" + SeriesYear + ")" comlocation = os.path.join(mylar.DESTINATION_DIR, comicdir, " (" + SeriesYear + ")")
else: else:
comlocation = mylar.DESTINATION_DIR + "/" + helpers.replace_all(mylar.FOLDER_FORMAT, values) comlocation = os.path.join(mylar.DESTINATION_DIR, helpers.replace_all(mylar.FOLDER_FORMAT, values))
#comlocation = mylar.DESTINATION_DIR + "/" + comicdir + " (" + comic['ComicYear'] + ")" #comlocation = mylar.DESTINATION_DIR + "/" + comicdir + " (" + comic['ComicYear'] + ")"
@ -367,7 +367,7 @@ def addComictoDB(comicid,mismatch=None,pullupd=None,imported=None,ogcname=None):
logger.info(u"Sucessfully retrieved cover for " + comic['ComicName']) logger.info(u"Sucessfully retrieved cover for " + comic['ComicName'])
#if the comic cover local is checked, save a cover.jpg to the series folder. #if the comic cover local is checked, save a cover.jpg to the series folder.
if mylar.COMIC_COVER_LOCAL: if mylar.COMIC_COVER_LOCAL:
comiclocal = os.path.join(str(comlocation) + "/cover.jpg") comiclocal = os.path.join(str(comlocation),'cover.jpg')
shutil.copy(ComicImage,comiclocal) shutil.copy(ComicImage,comiclocal)
except IOError as e: except IOError as e:
logger.error(u"Unable to save cover locally at this time.") logger.error(u"Unable to save cover locally at this time.")
@ -596,8 +596,9 @@ def addComictoDB(comicid,mismatch=None,pullupd=None,imported=None,ogcname=None):
#print str(issnum) #print str(issnum)
if 'au' in issnum.lower(): if 'au' in issnum.lower():
int_issnum = (int(issnum[:-2]) * 1000) + ord('a') + ord('u') int_issnum = (int(issnum[:-2]) * 1000) + ord('a') + ord('u')
elif 'ai' in issnum.lower(): # elif 'ai' in issnum.lower():
int_issnum = (int(issnum[:-2]) * 1000) + ord('a') + ord('i') # int_issnum = (int(issnum[:-2]) * 1000) + ord('a') + ord('i')
# print "ai:" + str(int_issnum)
elif u'\xbd' in issnum: elif u'\xbd' in issnum:
issnum = .5 issnum = .5
int_issnum = int(issnum) * 1000 int_issnum = int(issnum) * 1000
@ -618,7 +619,7 @@ def addComictoDB(comicid,mismatch=None,pullupd=None,imported=None,ogcname=None):
issaftdec = str(decisval) issaftdec = str(decisval)
try: try:
# int_issnum = str(issnum) # int_issnum = str(issnum)
int_issnum = (int(issb4dec) * 1000) + (int(issaftdec) * 100) int_issnum = (int(issb4dec) * 1000) + (int(issaftdec) * 10)
except ValueError: except ValueError:
logger.error("This has no issue #'s for me to get - Either a Graphic Novel or one-shot.") logger.error("This has no issue #'s for me to get - Either a Graphic Novel or one-shot.")
updater.no_searchresults(comicid) updater.no_searchresults(comicid)
@ -633,8 +634,29 @@ def addComictoDB(comicid,mismatch=None,pullupd=None,imported=None,ogcname=None):
int_issnum = (int(x)*1000) - 1 int_issnum = (int(x)*1000) - 1
else: raise ValueError else: raise ValueError
except ValueError, e: except ValueError, e:
logger.error(str(issnum) + " this has an alpha-numeric in the issue # which I cannot account for.") x = 0
return tstord = 0
issno = 0
while (x < len(issnum)):
if issnum[x].isalpha():
#take first occurance of alpha in string and carry it through
tstord = issnum[x:]
issno = issnum[:x]
break
x+=1
if tstord is not None and issno is not None:
logger.fdebug("tstord: " + str(tstord))
a = 0
ordtot = 0
while (a < len(tstord)):
ordtot += ord(tstord[a].lower()) #lower-case the letters for simplicty
a+=1
logger.fdebug("issno: " + str(issno))
int_issnum = (int(issno) * 1000) + ordtot
logger.fdebug("intissnum : " + str(int_issnum))
else:
logger.error(str(issnum) + " this has an alpha-numeric in the issue # which I cannot account for.")
return
#get the latest issue / date using the date. #get the latest issue / date using the date.
if firstval['Issue_Date'] > latestdate: if firstval['Issue_Date'] > latestdate:
latestiss = issnum latestiss = issnum

View file

@ -217,7 +217,7 @@ def nzbs(provider=None):
nonexp = "yes" nonexp = "yes"
elif nzbprovider[nzbpr] == 'dognzb': elif nzbprovider[nzbpr] == 'dognzb':
feed = 'http://dognzb.cr/rss?t=7030&dl=1&i=1&r=' + mylar.DOGNZB_APIKEY feed = 'http://dognzb.cr/rss?t=7030&dl=1&i=1&r=' + mylar.DOGNZB_APIKEY
feedme = feedparser.parser(feed) feedme = feedparser.parse(feed)
site = nzbprovider[nzbpr] site = nzbprovider[nzbpr]
ft+=1 ft+=1
nonexp = "yes" nonexp = "yes"

View file

@ -149,6 +149,9 @@ def upcoming_update(ComicID, ComicName, IssueNumber, IssueDate, forcecheck=None)
if 'annual' in ComicName.lower(): if 'annual' in ComicName.lower():
if mylar.ANNUALS_ON: if mylar.ANNUALS_ON:
issuechk = myDB.action("SELECT * FROM annuals WHERE ComicID=? AND Issue_Number=?", [ComicID, IssueNumber]).fetchone() issuechk = myDB.action("SELECT * FROM annuals WHERE ComicID=? AND Issue_Number=?", [ComicID, IssueNumber]).fetchone()
else:
logger.fdebug("Annual detected, but annuals not enabled. Ignoring result.")
return
else: else:
issuechk = myDB.action("SELECT * FROM issues WHERE ComicID=? AND Issue_Number=?", [ComicID, IssueNumber]).fetchone() issuechk = myDB.action("SELECT * FROM issues WHERE ComicID=? AND Issue_Number=?", [ComicID, IssueNumber]).fetchone()