1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Fixed home page issues.

Fixed episode status issues.
This commit is contained in:
echel0n 2014-12-19 05:49:57 -08:00
parent 6151062ea4
commit 9927e8ad92
2 changed files with 15 additions and 15 deletions

View File

@ -9,7 +9,7 @@
#set global $sbPath = ".." #set global $sbPath = ".."
#set global $topmenu="home"# #set global $topmenu="home"#
#import os.pat #import os.path
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl") #include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl")
#set $myDB = $db.DBConnection() #set $myDB = $db.DBConnection()

View File

@ -1777,9 +1777,6 @@ class Home(WebRoot):
# Possible status: Downloaded, Snatched, etc... # Possible status: Downloaded, Snatched, etc...
# Returns {'show': 279530, 'episodes' : ['episode' : 6, 'season' : 1, 'searchstatus' : 'queued', 'status' : 'running', 'quality': '4013'] # Returns {'show': 279530, 'episodes' : ['episode' : 6, 'season' : 1, 'searchstatus' : 'queued', 'status' : 'running', 'quality': '4013']
def getManualSearchStatus(self, show=None, season=None): def getManualSearchStatus(self, show=None, season=None):
episodes = []
def getEpisodes(searchThread, searchstatus): def getEpisodes(searchThread, searchstatus):
results = [] results = []
@ -1801,32 +1798,35 @@ class Home(WebRoot):
return results return results
episodes = []
# Queued Searches # Queued Searches
searchstatus = 'queued'
for searchThread in sickbeard.searchQueueScheduler.action.get_all_ep_from_queue(show): for searchThread in sickbeard.searchQueueScheduler.action.get_all_ep_from_queue(show):
episodes += getEpisodes(searchThread, 'queued') episodes += getEpisodes(searchThread, searchstatus)
# Running Searches # Running Searches
searchstatus = 'searching'
if (sickbeard.searchQueueScheduler.action.is_manualsearch_in_progress()): if (sickbeard.searchQueueScheduler.action.is_manualsearch_in_progress()):
searchThread = sickbeard.searchQueueScheduler.action.currentItem searchThread = sickbeard.searchQueueScheduler.action.currentItem
if searchThread.success: if searchThread.success:
searchstatus = 'finished' searchstatus = 'finished'
else:
searchstatus = 'searching'
episodes += getEpisodes(searchThread, searchstatus) episodes += getEpisodes(searchThread, searchstatus)
# Finished Searches # Finished Searches
for searchThread in sickbeard.search_queue.MANUAL_SEARCH_HISTORY:
if isinstance(searchThread, sickbeard.search_queue.ManualSearchQueueItem):
if str(searchThread.show.indexerid) == show and not [x for x in episodes if x[
'episodeindexid'] == searchThread.segment.indexerid]:
searchstatus = 'finished' searchstatus = 'finished'
for searchThread in sickbeard.search_queue.MANUAL_SEARCH_HISTORY:
if not int(searchThread.show.indexerid) == int(show or 0):
continue
if isinstance(searchThread, sickbeard.search_queue.ManualSearchQueueItem):
if not [x for x in episodes if x['episodeindexid'] == searchThread.segment.indexerid]:
episodes += getEpisodes(searchThread, searchstatus) episodes += getEpisodes(searchThread, searchstatus)
else: else:
### These are only Failed Downloads/Retry SearchThreadItems.. lets loop through the segement/episodes ### These are only Failed Downloads/Retry SearchThreadItems.. lets loop through the segement/episodes
if str(searchThread.show.indexerid) == show: if not [i for i, j in zip(searchThread.segment, episodes) if i.indexerid == j['episodeindexid']]:
for epObj in searchThread.segment:
if not [x for x in episodes if x['episodeindexid'] == epObj.indexerid]:
searchstatus = 'finished'
episodes += getEpisodes(searchThread, searchstatus) episodes += getEpisodes(searchThread, searchstatus)
return json.dumps({'show': show, 'episodes': episodes}) return json.dumps({'show': show, 'episodes': episodes})