FIX:(#659) annual error on startup, when annuals_on not enabled, FIX: error for week variable on weeklypull module

This commit is contained in:
evilhero 2014-04-03 00:42:23 -04:00
parent 0fa7a25f17
commit 1ace479a04
3 changed files with 4 additions and 25 deletions

View File

@ -845,10 +845,7 @@ def forceRescan(ComicID,archive=None):
archivedissues+=1 archivedissues+=1
pass pass
else: else:
logger.info('comiclocation: ' + str(rescan['ComicLocation']))
logger.info('filelocation: ' + str(down['Location']))
comicpath = os.path.join(rescan['ComicLocation'], down['Location']) comicpath = os.path.join(rescan['ComicLocation'], down['Location'])
logger.info('comicpath: ' + str(comicpath))
if os.path.exists(comicpath): if os.path.exists(comicpath):
pass pass
#print "Issue exists - no need to change status." #print "Issue exists - no need to change status."

View File

@ -66,39 +66,21 @@ class WebInterface(object):
comiclist = myDB.select('SELECT * from comics order by ComicSortName COLLATE NOCASE') comiclist = myDB.select('SELECT * from comics order by ComicSortName COLLATE NOCASE')
for comic in comiclist: for comic in comiclist:
issue = myDB.select("SELECT * FROM issues WHERE ComicID=?", [comic['ComicID']]) issue = myDB.select("SELECT * FROM issues WHERE ComicID=?", [comic['ComicID']])
wantedc = myDB.action("SELECT COUNT(*) as count FROM issues WHERE ComicID=? AND Status='Wanted'", [comic['ComicID']]).fetchone()
if mylar.ANNUALS_ON: if mylar.ANNUALS_ON:
annuals_on = True annuals_on = True
anwantedc = myDB.action("SELECT COUNT(*) as count FROM annuals WHERE ComicID=? AND Status='Wanted'", [comic['ComicID']]).fetchone()
annual = myDB.action("SELECT COUNT(*) as count FROM annuals WHERE ComicID=?", [comic['ComicID']]).fetchone() annual = myDB.action("SELECT COUNT(*) as count FROM annuals WHERE ComicID=?", [comic['ComicID']]).fetchone()
annualcount = annual[0] annualcount = annual[0]
if not annualcount: if not annualcount:
annualcount = 0 annualcount = 0
anns = anwantedc[0]
else:
annualcount = 0
anns = 0
else: else:
annuals_on = False annuals_on = False
anwantedc = 0 annual = None
annual = 0 annualcount = 0
totalissues = comic['Total'] + annualcount totalissues = comic['Total'] + annualcount
haveissues = comic['Have'] haveissues = comic['Have']
wants = wantedc[0]
if not haveissues: if not haveissues:
havetracks = 0 havetracks = 0
if not wants:
wants = 0
if not anns:
anns = 0
try:
wantpercent = (wants*100.0)/totalissues
if wantpercent > 100:
wantpercent = 100
except (ZeroDivisionError, TypeError):
wantpercent = 0
wants = '?'
try: try:
percent = (haveissues*100.0)/totalissues percent = (haveissues*100.0)/totalissues

View File

@ -809,7 +809,7 @@ def checkthis(datecheck,datestatus,usedate):
logger.fdebug('Store Date falls within acceptable range - series MATCH') logger.fdebug('Store Date falls within acceptable range - series MATCH')
valid_check = True valid_check = True
elif int(datecheck) < int(usedate): elif int(datecheck) < int(usedate):
logger.fdebug('The issue date of issue #' + str(week['ISSUE']) + ' was on ' + str(datecheck) + ' which is prior to ' + str(week['SHIPDATE'])) logger.fdebug('The issue date of issue was on ' + str(datecheck) + ' which is prior to ' + str(usedate))
valid_check = False valid_check = False
return valid_check return valid_check