FIX: Removed some more unnecessary log spamming when seaching, IMP: Added a 'type' field to the comicdetails page which will show whether or not a series is a Print or Digital Edition. This print/digital is also shown on the searchresults page

This commit is contained in:
evilhero 2016-07-20 15:49:41 -04:00
parent 6768e0e950
commit 95b9b10786
7 changed files with 67 additions and 7 deletions

View File

@ -134,6 +134,15 @@
<div>
<label><big>Status: </big><norm>${comic['Status']}</norm></label>
</div>
<%
if comic['Type'] == 'None' or comic['Type'] is None:
comictype = 'Print'
else:
comictype = 'Digital'
%>
<div>
<label><big>Edition: </big><norm>${comictype}</norm></label>
</div>
<div>
<label><big>Last Updated: </big>
%if comic['LastUpdated'] is None:

View File

@ -37,6 +37,7 @@
%>
<h1 class="clearfix"><img src="interfaces/default/images/icon_search.png" alt="Search results"/>${searchtext}</h1>
<!--
<div>
<form action="CreateFolders" method="GET" id="CreatetheFolders">
<fieldset>
@ -47,6 +48,7 @@
</fieldset>
</form>
</div>
-->
</div>
<div class="table_wrapper">
<table class="display" id="searchresults_table">
@ -70,13 +72,25 @@
grade = 'Z'
if result['haveit'] != "No":
grade = 'H';
if result['type'] == 'Digital':
rtype = '[Digital]'
else:
rtype = None
%>
<tr class="grade${grade}">
<td class="blank"></td>
%if result['deck'] == 'None' or result['deck'] is None:
<td class="name"><a href="${result['url']}" target="_blank">${result['name']}</a></td>
%if rtype is None:
<td class="name"><a href="${result['url']}" target="_blank">${result['name']}</a></td>
%else:
<td class="name"><a href="${result['url']}" target="_blank">${result['name']} ${rtype}</a></td>
%endif
%else:
<td class="name"><a href="${result['url']}" title="${result['deck']}" target="_blank">${result['name']}</a></td>
%if rtype is None:
<td class="name"><a href="${result['url']}" title="${result['deck']}" target="_blank">${result['name']}</a></td>
%else:
<td class="name"><a href="${result['url']}" title="${result['deck']}" target="_blank">${result['name']} ${rtype}</a></td>
%endif
%endif
<td class="publisher">${result['publisher']}</a></td>
<td class="comicyear">${result['comicyear']}</a></td>

View File

@ -1642,7 +1642,7 @@ def dbcheck():
c_error = 'sqlite3.OperationalError'
c=conn.cursor()
c.execute('CREATE TABLE IF NOT EXISTS comics (ComicID TEXT UNIQUE, ComicName TEXT, ComicSortName TEXT, ComicYear TEXT, DateAdded TEXT, Status TEXT, IncludeExtras INTEGER, Have INTEGER, Total INTEGER, ComicImage TEXT, ComicPublisher TEXT, ComicLocation TEXT, ComicPublished TEXT, NewPublish TEXT, LatestIssue TEXT, LatestDate TEXT, Description TEXT, QUALalt_vers TEXT, QUALtype TEXT, QUALscanner TEXT, QUALquality TEXT, LastUpdated TEXT, AlternateSearch TEXT, UseFuzzy TEXT, ComicVersion TEXT, SortOrder INTEGER, DetailURL TEXT, ForceContinuing INTEGER, ComicName_Filesafe TEXT, AlternateFileName TEXT, ComicImageURL TEXT, ComicImageALTURL TEXT, DynamicComicName TEXT, AllowPacks TEXT)')
c.execute('CREATE TABLE IF NOT EXISTS comics (ComicID TEXT UNIQUE, ComicName TEXT, ComicSortName TEXT, ComicYear TEXT, DateAdded TEXT, Status TEXT, IncludeExtras INTEGER, Have INTEGER, Total INTEGER, ComicImage TEXT, ComicPublisher TEXT, ComicLocation TEXT, ComicPublished TEXT, NewPublish TEXT, LatestIssue TEXT, LatestDate TEXT, Description TEXT, QUALalt_vers TEXT, QUALtype TEXT, QUALscanner TEXT, QUALquality TEXT, LastUpdated TEXT, AlternateSearch TEXT, UseFuzzy TEXT, ComicVersion TEXT, SortOrder INTEGER, DetailURL TEXT, ForceContinuing INTEGER, ComicName_Filesafe TEXT, AlternateFileName TEXT, ComicImageURL TEXT, ComicImageALTURL TEXT, DynamicComicName TEXT, AllowPacks TEXT, Type TEXT)')
c.execute('CREATE TABLE IF NOT EXISTS issues (IssueID TEXT, ComicName TEXT, IssueName TEXT, Issue_Number TEXT, DateAdded TEXT, Status TEXT, Type TEXT, ComicID TEXT, ArtworkURL Text, ReleaseDate TEXT, Location TEXT, IssueDate TEXT, Int_IssueNumber INT, ComicSize TEXT, AltIssueNumber TEXT, IssueDate_Edit TEXT)')
c.execute('CREATE TABLE IF NOT EXISTS snatched (IssueID TEXT, ComicName TEXT, Issue_Number TEXT, Size INTEGER, DateAdded TEXT, Status TEXT, FolderName TEXT, ComicID TEXT, Provider TEXT)')
c.execute('CREATE TABLE IF NOT EXISTS upcoming (ComicName TEXT, IssueNumber TEXT, ComicID TEXT, IssueID TEXT, IssueDate TEXT, Status TEXT, DisplayComicName TEXT)')
@ -1752,6 +1752,10 @@ def dbcheck():
except sqlite3.OperationalError:
c.execute('ALTER TABLE comics ADD COLUMN AllowPacks TEXT')
try:
c.execute('SELECT Type from comics')
except sqlite3.OperationalError:
c.execute('ALTER TABLE comics ADD COLUMN Type TEXT')
try:
c.execute('SELECT DynamicComicName from comics')

View File

@ -306,6 +306,23 @@ def GetComicInfo(comicid, dom, safechk=None):
#logger.info('comic_desc:' + comic_desc)
#logger.info('comic_deck:' + comic_deck)
#logger.info('desdeck: ' + str(desdeck))
#figure out if it's a print / digital edition.
comic['Type'] = 'None'
if comic_deck != 'None':
if any(['print' in comic_deck.lower(), 'digital' in comic_deck.lower()]):
if 'print' in comic_deck.lower():
comic['Type'] = 'Print'
elif 'digital' in comic_deck.lower():
comic['Type'] = 'Digital'
if comic_desc != 'None' and comic['Type'] == 'None':
if 'print' in comic_desc[:60].lower() and 'print edition can be found' not in comic_desc.lower():
comic['Type'] = 'Print'
elif 'digital' in comic_desc[:60].lower() and 'digital edition can be found' not in comic_desc.lower():
comic['Type'] = 'Digital'
else:
comic['Type'] = 'Print'
while (desdeck > 0):
if desdeck == 1:
if comic_desc == 'None':

View File

@ -529,6 +529,7 @@ def addComictoDB(comicid, mismatch=None, pullupd=None, imported=None, ogcname=No
"DetailURL": comic['ComicURL'],
# "ComicPublished": gcdinfo['resultPublished'],
"ComicPublished": "Unknown",
"Type": comic['Type'],
"DateAdded": helpers.today(),
"Status": "Loading"}

View File

@ -346,6 +346,20 @@ def findComic(name, mode, issue, limityear=None, explicit=None, type=None):
except:
xmldeck = "None"
xmltype = None
if xmldeck != 'None':
if any(['print' in xmldeck.lower(), 'digital' in xmldeck.lower()]):
if 'print' in xmldeck.lower():
xmltype = 'Print'
elif 'digital' in xmldeck.lower():
xmltype = 'Digital'
if xmldesc != 'None' and xmltype is None:
if 'print' in xmldesc[:60].lower() and 'print edition can be found' not in xmldesc.lower():
xmltype = 'Print'
elif 'digital' in xmldesc[:60].lower() and 'digital edition can be found' not in xmldesc.lower():
xmltype = 'Digital'
else:
xmltype = 'Print'
if xmlid in comicLibrary:
haveit = comicLibrary[xmlid]
@ -361,6 +375,7 @@ def findComic(name, mode, issue, limityear=None, explicit=None, type=None):
'publisher': xmlpub,
'description': xmldesc,
'deck': xmldeck,
'type': xmltype,
'haveit': haveit,
'lastissueid': xml_lastissueid,
'seriesrange': yearRange # returning additional information about series run polled from CV

View File

@ -489,9 +489,9 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
mod_isssearch = str(issdig) + str(isssearch)
#--- this is basically for RSS Feeds ---
logger.fdebug('RSS Check: ' + str(RSS))
logger.fdebug('nzbprov: ' + str(nzbprov))
logger.fdebug('comicid: ' + str(ComicID))
#logger.fdebug('RSS Check: ' + str(RSS))
#logger.fdebug('nzbprov: ' + str(nzbprov))
#logger.fdebug('comicid: ' + str(ComicID))
if RSS == "yes":
if nzbprov == '32P' or nzbprov == 'KAT':
cmname = re.sub("%20", " ", str(comsrc))
@ -1966,7 +1966,7 @@ def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, direc
else:
logger.info('Download URL: ' + down_url + '?' + urllib.urlencode(payload) + ' [VerifySSL:' + str(verify) + ']')
if down_url.startswith('https'):
if down_url.startswith('https') and verify == False:
try:
from lib.requests.packages.urllib3 import disable_warnings
disable_warnings()