From 05ac670ccc2ae4ec6e22aef81cb8f4b150125d64 Mon Sep 17 00:00:00 2001 From: DarkSir23 Date: Thu, 7 Dec 2017 14:24:25 -0500 Subject: [PATCH] Issue Searching for OPDS --- mylar/opds.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mylar/opds.py b/mylar/opds.py index 57b198c3..c05a0e2d 100644 --- a/mylar/opds.py +++ b/mylar/opds.py @@ -484,17 +484,18 @@ class OPDS(object): self.data = self._error_with_message('No ComicID Provided') return myDB = db.DBConnection() - issue = myDB.selectone("SELECT * from issues WHERE IssueID=?", (kwargs['issueid'],)).fetchone() issuetype = 0 + issue = myDB.selectone("SELECT * from readinglist WHERE IssueID=? and Location IS NOT NULL", + (kwargs['issueid'],)).fetchone() if not issue: - issue = myDB.selectone("SELECT * from annuals WHERE IssueID=?", (kwargs['issueid'],)).fetchone() + issue = myDB.selectone("SELECT * from issues WHERE IssueID=?", (kwargs['issueid'],)).fetchone() if not issue: - issue = myDB.selectone("SELECT * from readinglist WHERE IssueID=? and Location IS NOT NULL", (kwargs['issueid'],)).fetchone() + issue = myDB.selectone("SELECT * from annuals WHERE IssueID=?", (kwargs['issueid'],)).fetchone() if not issue: self.data = self._error_with_message('Issue Not Found') return - else: - issuetype = 1 + else: + issuetype = 1 comic = myDB.selectone("SELECT * from comics WHERE ComicID=?", (issue['ComicID'],)).fetchone() if not comic: self.data = self._error_with_message('Comic Not Found')