From 1ace479a04cbe23e8d7b32ab1a3a6e63f8733bf7 Mon Sep 17 00:00:00 2001 From: evilhero Date: Thu, 3 Apr 2014 00:42:23 -0400 Subject: [PATCH] FIX:(#659) annual error on startup, when annuals_on not enabled, FIX: error for week variable on weeklypull module --- mylar/updater.py | 3 --- mylar/webserve.py | 24 +++--------------------- mylar/weeklypull.py | 2 +- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/mylar/updater.py b/mylar/updater.py index c2495e9b..f1ed179f 100755 --- a/mylar/updater.py +++ b/mylar/updater.py @@ -845,10 +845,7 @@ def forceRescan(ComicID,archive=None): archivedissues+=1 pass else: - logger.info('comiclocation: ' + str(rescan['ComicLocation'])) - logger.info('filelocation: ' + str(down['Location'])) comicpath = os.path.join(rescan['ComicLocation'], down['Location']) - logger.info('comicpath: ' + str(comicpath)) if os.path.exists(comicpath): pass #print "Issue exists - no need to change status." diff --git a/mylar/webserve.py b/mylar/webserve.py index 647d8db5..d6ddd1db 100755 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -66,39 +66,21 @@ class WebInterface(object): comiclist = myDB.select('SELECT * from comics order by ComicSortName COLLATE NOCASE') for comic in comiclist: 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: 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() annualcount = annual[0] if not annualcount: annualcount = 0 - anns = anwantedc[0] - else: - annualcount = 0 - anns = 0 else: annuals_on = False - anwantedc = 0 - annual = 0 + annual = None + annualcount = 0 totalissues = comic['Total'] + annualcount haveissues = comic['Have'] - wants = wantedc[0] + if not haveissues: 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: percent = (haveissues*100.0)/totalissues diff --git a/mylar/weeklypull.py b/mylar/weeklypull.py index 38720e56..1c971a55 100755 --- a/mylar/weeklypull.py +++ b/mylar/weeklypull.py @@ -809,7 +809,7 @@ def checkthis(datecheck,datestatus,usedate): logger.fdebug('Store Date falls within acceptable range - series MATCH') valid_check = True 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 return valid_check