1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2025-03-09 13:24:53 +00:00

Annuals link to series

Redesigned listLibrary as a dictionary. Annuals now link to their
series.
This commit is contained in:
TheLabRatt 2014-10-08 19:17:44 +01:00 committed by evilhero
parent b116df5227
commit 5bfe348e72
3 changed files with 12 additions and 10 deletions

View file

@ -64,7 +64,7 @@
grade = 'A'
else:
grade = 'Z'
if result['haveit'] == "Yes":
if result['haveit'] != "No":
grade = 'H';
%>
<tr class="grade${grade}">
@ -77,7 +77,7 @@
%if result['haveit'] == "No":
<td class="add" nowrap="nowrap"><a href="addComic?comicid=${result['comicid']}&comicname=${result['name'] |u}&comicyear=${result['comicyear']}&comicpublisher=${result['publisher'] |u}&comicimage=${result['comicimage']}&comicissues=${result['issues']}&imported=${imported}&ogcname=${ogcname}&serinfo=${serinfo}"><span class="ui-icon ui-icon-plus"></span> Add this Comic</a></td>
%else:
<td class="add" nowrap="nowrap"><a href="comicDetails?ComicID=${result['comicid']}"><span class="ui-icon ui-icon-arrowreturnthick-1-n"></span> Already in library</a></td>
<td class="add" nowrap="nowrap"><a href="comicDetails?ComicID=${result['haveit']}"><span class="ui-icon ui-icon-arrowreturnthick-1-n"></span> Already in library</a></td>
%endif
</tr>
%endfor

View file

@ -1438,16 +1438,18 @@ def int_num(s):
def listLibrary():
import db
library = []
library = {}
myDB = db.DBConnection()
# Get individual comics
# # Get individual comics
list = myDB.select("SELECT ComicId FROM Comics")
for row in list:
library.append(row['ComicId'])
library[row['ComicID']] = row['ComicID']
# library.append(row['ComicId'])
# Add the annuals
list = myDB.select("SELECT ReleaseComicId FROM Annuals")
list = myDB.select("SELECT ReleaseComicId,ComicID FROM Annuals")
for row in list:
library.append(row['ReleaseComicId'])
library[row['ReleaseComicId']] = row['ComicID']
# library.append(row['ReleaseComicId'])
return library
from threading import Thread

View file

@ -235,9 +235,9 @@ def findComic(name, mode, issue, limityear=None, explicit=None, type=None):
xmldesc = "None"
if xmlid in comicLibrary:
haveit = "Yes"
haveit = comicLibrary[xmlid]
else:
haveit = "No"
haveit = "No"
comiclist.append({
'name': xmlTag,
@ -289,7 +289,7 @@ def findComic(name, mode, issue, limityear=None, explicit=None, type=None):
except:
xmldesc = "None"
if xmlid in comicLibrary:
haveit = "Yes"
haveit = comicLibrary[xmlid]
else:
haveit = "No"
comiclist.append({