IMP: Added 'Manually check for issues' button on weekly tab where it will search for any Wanted issues on the pullist in an non-Downloaded status, IMP: Sorted Wanted tab so most recent is at top, followed by Status order (Wanted, Snatched, Failed), IMP: Sorted Newznabs in GUI so that enabled are at the top and disabled newznabs are nearer to the bottom, IMP: When force searching, will now start with the most recent issues as opposed to a random sequence order

This commit is contained in:
evilhero 2017-05-18 14:45:29 -04:00
parent 20051f6c26
commit d70eab5a4a
3 changed files with 28 additions and 2 deletions

View File

@ -11,6 +11,7 @@
<a href="#" id="menu_link_refresh" onclick="doAjaxCall('pullist?week=${weekinfo['weeknumber']}&year=${weekinfo['year']}',$(this),'table')" data-success="Refresh submitted.">Refresh Pull-list</a>
<a id="menu_link_retry" href="pullrecreate">Recreate Pull-list</a>
<a id="menu_link_scan" class="button">Download</a>
<a href="#" id="menu_link_refresh" onclick="doAjaxCall('pullSearch?week=${weekinfo['weeknumber']}&year=${weekinfo['year']}',$(this),'table')" data-success="Submitted background search request for new pull issues">Manually check for issues</a>
</div>
</div>
<a href="home" class="back">&laquo; Back to overview</a>

View File

@ -1674,6 +1674,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
return foundc
def searchforissue(issueid=None, new=False, rsscheck=None):
myDB = db.DBConnection()
if not issueid or rsscheck:
@ -1723,7 +1724,7 @@ def searchforissue(issueid=None, new=False, rsscheck=None):
#to-do: re-order the results list so it's most recent to least recent.
for result in results:
for result in sorted(results, key=itemgetter('StoreDate'), reverse=True):
comic = myDB.selectone("SELECT * from comics WHERE ComicID=? AND ComicName != 'None'", [result['ComicID']]).fetchone()
if comic is None:
logger.fdebug(str(result['ComicID']) + ' has no associated comic information. Skipping searching for this series.')
@ -2267,6 +2268,8 @@ def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, direc
if any([mylar.USE_RTORRENT, mylar.USE_DELUGE]) and mylar.AUTO_SNATCH:
mylar.SNATCHED_QUEUE.put(rcheck['hash'])
elif any([mylar.USE_RTORRENT, mylar.USE_DELUGE]) and mylar.LOCAL_TORRENT_PP:
mylar.SNATCHED_QUEUE.put(rcheck['hash'])
else:
if mylar.ENABLE_SNATCH_SCRIPT:
if comicinfo[0]['pack'] is False:

View File

@ -1585,6 +1585,25 @@ class WebInterface(object):
raise cherrypy.HTTPRedirect("comicDetails?ComicID=%s" % comicid)
archiveissue.exposed = True
def pullSearch(self, week, year):
myDB = db.DBConnection()
#retrieve a list of all the issues that are in a Wanted state from the pull that we can search for.
ps = myDB.select("SELECT * from weekly WHERE Status='Wanted' AND weeknumber=? AND year=?", [int(week), year])
if ps is None:
logger.info('No items are marked as Wanted on the pullist to be searched for at this time')
return
issuesToSearch = []
for p in ps:
if p['IssueID'] is not None:
issuesToSearch.append(p['IssueID'])
if len(issuesToSearch) > 0:
logger.info('Now force searching for ' + str(len(issuesToSearch)) + ' issues from the pullist for week ' + str(week))
threading.Thread(target=search.searchIssueIDList, args=[issuesToSearch]).start()
else:
logger.info('Issues are marked as Wanted, but no issue information is available yet so I cannot search for anything. Try Recreating the pullist if you think this is error.')
return
pullSearch.exposed = True
def pullist(self, week=None, year=None):
myDB = db.DBConnection()
@ -1998,6 +2017,9 @@ class WebInterface(object):
ann_list += annuals_list
issues += annuals_list
issues_tmp = sorted(issues, key=itemgetter('ReleaseDate'), reverse=True)
issues = sorted(issues_tmp, key=itemgetter('Status'), reverse=True)
for curResult in issues:
baseissues = {'wanted': 1, 'snatched': 2, 'failed': 3}
for seas in baseissues:
@ -4189,7 +4211,7 @@ class WebInterface(object):
"newznab_api": mylar.NEWZNAB_APIKEY,
"newznab_uid": mylar.NEWZNAB_UID,
"newznab_enabled": helpers.checked(mylar.NEWZNAB_ENABLED),
"extra_newznabs": mylar.EXTRA_NEWZNABS,
"extra_newznabs": sorted(mylar.EXTRA_NEWZNABS, key=itemgetter(5), reverse=True),
"enable_rss": helpers.checked(mylar.ENABLE_RSS),
"rss_checkinterval": mylar.RSS_CHECKINTERVAL,
"provider_order": mylar.PROVIDER_ORDER,