1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-10 19:35:08 -05:00

Merge pull request #786 from adam111316/queue_info

Add search queue info to ManageSearches page
This commit is contained in:
adam111316 2014-09-08 14:45:03 +08:00
commit 7adc669789
3 changed files with 25 additions and 1 deletions

View File

@ -47,6 +47,15 @@ In Progress<br />
<h3>Version Check:</h3>
<a class="btn" href="$sbRoot/manage/manageSearches/forceVersionCheck"><i class="icon-check"></i> Force Check</a>
<br />
<br /> <br />
<h3>Search Queue:</h3>
Backlog: <i>$queueLength['backlog'] pending items</i></br>
Daily: <i>$queueLength['daily'] pending items</i></br>
Manual: <i>$queueLength['manual'] pending items</i></br>
Failed: <i>$queueLength['failed'] pending items</i></br>
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_bottom.tmpl")

View File

@ -77,6 +77,20 @@ class SearchQueue(generic_queue.GenericQueue):
return True
return False
def queue_length(self):
length = {'backlog': 0, 'daily': 0, 'manual': 0, 'failed': 0}
for cur_item in self.queue:
if isinstance(cur_item, DailySearchQueueItem):
length['backlog'] += 1
elif isinstance(cur_item, BacklogQueueItem):
length['daily'] += 1
elif isinstance(cur_item, ManualSearchQueueItem):
length['manual'] += 1
elif isinstance(cur_item, FailedQueueItem):
length['failed'] += 1
return length
def add_item(self, item):
if isinstance(item, DailySearchQueueItem):
# daily searches

View File

@ -596,6 +596,7 @@ class ManageSearches(MainHandler):
t.backlogRunning = sickbeard.searchQueueScheduler.action.is_backlog_in_progress() # @UndefinedVariable
t.dailySearchStatus = sickbeard.dailySearchScheduler.action.amActive # @UndefinedVariable
t.findPropersStatus = sickbeard.properFinderScheduler.action.amActive # @UndefinedVariable
t.queueLength = sickbeard.searchQueueScheduler.action.queue_length()
t.submenu = ManageMenu()