FIX: fuzzy year selection would error out if not selected, IMP: fuzzy year option will now show correct prior selection on Edit screen, FIX: Upcoming section (Wanted tab) will only show releases that are NOT available for download now.

This commit is contained in:
evilhero 2013-01-15 17:41:00 -05:00
parent a8c1ae766a
commit c307e6a975
3 changed files with 17 additions and 17 deletions

View File

@ -194,9 +194,9 @@
</div>
<label>Year Options</label>
<div class="row radio left clearfix">
<input type="radio" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="fuzzy_year" value="0" /><label>Keep the Year as is<small>Default</small></label>
<input type="radio" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="fuzzy_year" value="1" /><label>Year Removal<small>Remove issue publication year from searches (dangerous)</small></label>
<input type="radio" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="fuzzy_year" value="2" /><label>Fuzzy the Year<small>Increase & Decrease the issue publication year by one</small></label>
<input type="radio" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="fuzzy_year" value="0" ${comicConfig['fuzzy_year0']} /><label>Keep the Year as is<small>Default</small></label>
<input type="radio" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="fuzzy_year" value="1" ${comicConfig['fuzzy_year1']} /><label>Year Removal<small>Remove issue publication year from searches (dangerous)</small></label>
<input type="radio" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="fuzzy_year" value="2" ${comicConfig['fuzzy_year2']} /><label>Fuzzy the Year<small>Increase & Decrease the issue publication year by one</small></label>
</div>
<input type="submit" value="Update"/>
</div>

View File

@ -93,6 +93,7 @@ def upcoming_update(ComicID, ComicName, IssueNumber, IssueDate):
logger.fdebug("Available to be marked for download - checking..." + str(issuechk['ComicName']) + " Issue: " + str(issuechk['Issue_Number']))
logger.fdebug("...Existing status: " + str(issuechk['Status']))
control = {"IssueID": issuechk['IssueID']}
newValue['IssueID'] = issuechk['IssueID']
if issuechk['Status'] == "Snatched":
values = { "Status": "Snatched"}
newValue['Status'] = "Snatched"
@ -106,7 +107,7 @@ def upcoming_update(ComicID, ComicName, IssueNumber, IssueDate):
values = { "Status": "Skipped"}
newValue['Status'] = "Skipped"
#was in wrong place :(
if mylar.AUTOWANT_UPCOMING:
if mylar.AUTOWANT_UPCOMING:
#for issues not in db - to be added to Upcoming table.
if issuechk is None:
newValue['Status'] = "Wanted"

View File

@ -69,9 +69,13 @@ class WebInterface(object):
issues = myDB.select('SELECT * from issues WHERE ComicID=? order by Int_IssueNumber DESC', [ComicID])
if comic is None:
raise cherrypy.HTTPRedirect("home")
usethefuzzy = comic['UseFuzzy']
if usethefuzzy is None: usethefuzzy = "0"
comicConfig = {
"comiclocation" : mylar.COMIC_LOCATION,
"use_fuzzy" : comic['UseFuzzy']
"fuzzy_year0" : helpers.radio(int(usethefuzzy), 0),
"fuzzy_year1" : helpers.radio(int(usethefuzzy), 1),
"fuzzy_year2" : helpers.radio(int(usethefuzzy), 2)
}
return serve_template(templatename="artistredone.html", title=comic['ComicName'], comic=comic, issues=issues, comicConfig=comicConfig)
artistPage.exposed = True
@ -414,7 +418,7 @@ class WebInterface(object):
def upcoming(self):
myDB = db.DBConnection()
#upcoming = myDB.select("SELECT * from issues WHERE ReleaseDate > date('now') order by ReleaseDate DESC")
upcoming = myDB.select("SELECT * from upcoming WHERE IssueDate > date('now') order by IssueDate DESC")
upcoming = myDB.select("SELECT * from upcoming WHERE IssueDate > date('now') AND IssueID is NULL order by IssueDate DESC")
issues = myDB.select("SELECT * from issues WHERE Status='Wanted'")
#let's move any items from the upcoming table into the wanted table if the date has already passed.
#gather the list...
@ -629,16 +633,6 @@ class WebInterface(object):
def comic_config(self, com_location, alt_search, ComicID, fuzzy_year=None):
myDB = db.DBConnection()
print ("fuzzy:" + fuzzy_year)
if fuzzy_year is not None:
newValues['UseFuzzy'] = fuzzy_year
if fuzzy_year == '0':
fuzzy_string = "None"
elif fuzzy_year == '1':
fuzzy_string = "Remove Year"
elif fuzzy_year == '2':
fuzzy_string = "Fuzzy Year"
#--- this is for multipe search terms............
#--- works, just need to redo search.py to accomodate multiple search terms
# ffs_alt = []
@ -669,13 +663,18 @@ class WebInterface(object):
controlValueDict = {'ComicID': ComicID}
newValues = {"ComicLocation": com_location,
"AlternateSearch": str(asearch) }
#"QUALalt_vers": qual_altvers,
#"QUALScanner": qual_scanner,
#"QUALtype": qual_type,
#"QUALquality": qual_quality
#}
if fuzzy_year is None:
newValues['UseFuzzy'] = "0"
else:
newValues['UseFuzzy'] = str(fuzzy_year)
#force the check/creation of directory com_location here
if os.path.isdir(str(com_location)):
logger.info(u"Validating Directory (" + str(com_location) + "). Already exists! Continuing...")