Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
fix for ' in ComicNames not being able to change status / download'
Browse files Browse the repository at this point in the history
  • Loading branch information
evilhero committed Oct 1, 2012
1 parent 75f5834 commit 8d234c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions data/interfaces/default/artistredone.html
Expand Up @@ -212,11 +212,11 @@ <h3><i>(Comic information is currently being loaded)</i></h3>
<td id="type">${issue['Type']}</td>
<td id="status">${issue['Status']}
%if issue['Status'] == 'Skipped':
[<a href="#" onclick="doAjaxCall('queueissue?ComicName=${issue['ComicName']}&ComicID=${issue['ComicID']}&IssueID=${issue['IssueID']}&ComicIssue=${issue['Issue_Number']}&ComicYear=${issue['IssueDate']}&mode=want',$(this),'table')">want</a>]
[<a href="#" onclick="doAjaxCall('queueissue?ComicID=${issue['ComicID']}&IssueID=${issue['IssueID']}&ComicIssue=${issue['Issue_Number']}&ComicYear=${issue['IssueDate']}&mode=want',$(this),'table')">want</a>]
%elif (issue['Status'] == 'Wanted'):
[<a href="#" onclick="doAjaxCall('unqueueissue?IssueID=${issue['IssueID']}&ComicID=${issue['ComicID']}',$(this),'table')" data-success="'${issue['Issue_Number']}' has been marked as skipped">skip</a>]
%else:
[<a href="#" onclick="doAjaxCall('queueissue?ComicName=${issue['ComicName']}&ComicID=${issue['ComicID']}&IssueID=${issue['IssueID']}&ComicIssue=${issue['Issue_Number']}&mode=want', $(this),'table')" data-success="Retrying the same version of '${issue['ComicName']}' '${issue['Issue_Number']}'" title="Retry the same download again">retry</a>][<a href="#" onclick="doAjaxCall('queueissue?IssueID=${issue['IssueID']}&ComicID=${issue['ComicID']}&ComicName=${issue['ComicName']}&ComicIssue=${issue['Issue_Number']}&new=True', $(this),'table')" title="Try a new download, skipping all previously tried nzbs" data-success="Downloading new version for '${issue['ComicName']}' '${issue['Issue_Number']}'" data-success="Looking for a new version of '${issue['ComicName']}' '${issue['Issue_Number']}'">new</a>]
[<a href="#" onclick="doAjaxCall('queueissue?ComicID=${issue['ComicID']}&IssueID=${issue['IssueID']}&ComicIssue=${issue['Issue_Number']}&mode=want', $(this),'table')" data-success="Retrying the same version of '${issue['ComicName']}' '${issue['Issue_Number']}'" title="Retry the same download again">retry</a>][<a href="#" onclick="doAjaxCall('queueissue?IssueID=${issue['IssueID']}&ComicID=${issue['ComicID']}&ComicIssue=${issue['Issue_Number']}&new=True', $(this),'table')" title="Try a new download, skipping all previously tried nzbs" data-success="Downloading new version for '${issue['ComicName']}' '${issue['Issue_Number']}'" data-success="Looking for a new version of '${issue['ComicName']}' '${issue['Issue_Number']}'">new</a>]
%endif
</td>
</tr>
Expand Down
9 changes: 3 additions & 6 deletions mylar/webserve.py
Expand Up @@ -168,11 +168,6 @@ def markissues(self, ComicID=None, action=None, **args):
ComicID = mi['ComicID']
#print ("ComicID: " + str(ComicID))
comic = myDB.action('SELECT * FROM comics WHERE ComicID=?', [ComicID]).fetchone()
#print ("comic location: " + comic['ComicLocation'])
#fc = filechecker.listFiles(comic['ComicLocation'], mi['ComicName'])
#HaveDict = {'ComicID': ComicID}
#newHave = { 'Have': fc['comiccount'] }
#myDB.upsert("comics", newHave, HaveDict)
controlValueDict = {'IssueID': IssueID}
newValueDict = {'Status': 'Snatched'}
myDB.upsert("issues", newValueDict, controlValueDict)
Expand All @@ -198,7 +193,7 @@ def addArtists(self, **args):
raise cherrypy.HTTPRedirect("home")
addArtists.exposed = True

def queueissue(self, ComicName, mode, ComicID=None, ComicYear=None, ComicIssue=None, IssueID=None, new=False, redirect=None):
def queueissue(self, mode, ComicName=None, ComicID=None, ComicYear=None, ComicIssue=None, IssueID=None, new=False, redirect=None):
myDB = db.DBConnection()
#mode dictates type of queue - either 'want' for individual comics, or 'series' for series watchlist.
if ComicID is None and mode == 'series':
Expand All @@ -222,6 +217,8 @@ def queueissue(self, ComicName, mode, ComicID=None, ComicYear=None, ComicIssue=N
logger.info(u"Downloaded " + ComicName + " " + ComicIssue )
return
elif mode == 'want':
cdname = myDB.action("SELECT ComicName from comics where ComicID=?", [ComicID]).fetchone()
ComicName = cdname['ComicName']
logger.info(u"Marking " + ComicName + " issue: " + ComicIssue + " as wanted...")
#---
#this should be on it's own somewhere
Expand Down

0 comments on commit 8d234c5

Please sign in to comment.