From 058f9d1399ba29d1ea493834b43c32cd712d6d8f Mon Sep 17 00:00:00 2001 From: KontiSR Date: Tue, 23 Sep 2014 11:06:02 +0200 Subject: [PATCH] This is a check used in webserve.py getManualSearchStatus(), to get the current running queuitem, if it is a manual or failed/retry search. If so, the frontend will report the matching episode as in status "searching". The function is_manualsearch_in_progress() is introduced for this purpose and only reference in webserve.py. Previously when a daily search is running, and a manual search is queued behind it, it will wrongly give back that the manual search is running, this could result in unexpected behavior. --- sickbeard/search_queue.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sickbeard/search_queue.py b/sickbeard/search_queue.py index 564e4f8b..3fa20e75 100644 --- a/sickbeard/search_queue.py +++ b/sickbeard/search_queue.py @@ -84,9 +84,9 @@ class SearchQueue(generic_queue.GenericQueue): return self.min_priority >= generic_queue.QueuePriorities.NORMAL def is_manualsearch_in_progress(self): - for cur_item in self.queue + [self.currentItem]: - if isinstance(cur_item, (ManualSearchQueueItem, FailedQueueItem)): - return True + # Only referenced in webserve.py, only current running manualsearch or failedsearch is needed!! + if isinstance(self.currentItem, (ManualSearchQueueItem, FailedQueueItem)): + return True return False def is_backlog_in_progress(self):