From daeee0d250340833996c8be301dacfa294a4b460 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Sat, 24 Mar 2018 09:04:51 +0000 Subject: [PATCH] Fix search for wanted when adding new show. Change don't prevent specific backlog run, if another backlog is running. --- CHANGES.md | 7 ++++++- sickbeard/search_backlog.py | 4 ++-- sickbeard/show_queue.py | 20 +++++++++++--------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1ba674ad..7ccd5417 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ -### 0.15.1 (2018-03-23 22:30:00 UTC) +### 0.15.2 (2018-03-28 01:45:00 UTC) + +* Fix search for wanted when adding new show + + +### 0.15.1 (2018-03-23 22:30:00 UTC) * Fix overwriting repack where renamed filename has '-' in title * Fix Growl display correct message on test notification success + change notification icon diff --git a/sickbeard/search_backlog.py b/sickbeard/search_backlog.py index 202bf354..464f8772 100644 --- a/sickbeard/search_backlog.py +++ b/sickbeard/search_backlog.py @@ -145,7 +145,7 @@ class BacklogSearcher: def search_backlog(self, which_shows=None, force_type=NORMAL_BACKLOG, force=False): - if self.amActive: + if self.amActive and not which_shows: logger.log(u'Backlog is still running, not starting it again', logger.DEBUG) return @@ -185,8 +185,8 @@ class BacklogSearcher: if standard_backlog and not any_torrent_enabled and sickbeard.BACKLOG_NOFULL: logger.log(u'Skipping automated full backlog search because it is disabled in search settings') + my_db = db.DBConnection('cache.db') if standard_backlog and not any_torrent_enabled and not sickbeard.BACKLOG_NOFULL: - my_db = db.DBConnection('cache.db') sql_result = my_db.select('SELECT * FROM backlogparts WHERE part in (SELECT MIN(part) FROM backlogparts)') if sql_result: sl = [] diff --git a/sickbeard/show_queue.py b/sickbeard/show_queue.py index beaf98a9..3617bd9e 100644 --- a/sickbeard/show_queue.py +++ b/sickbeard/show_queue.py @@ -460,15 +460,6 @@ class QueueItemAdd(ShowQueueItem): items_wanted = get_wanted(my_db, self.default_wanted_begin, latest=False) items_wanted += get_wanted(my_db, self.default_wanted_latest, latest=True) - msg = ' the specified show into ' + self.showDir - # if started with WANTED eps then run the backlog - if WANTED == self.default_status or items_wanted: - logger.log('Launching backlog for this show since episodes are WANTED') - sickbeard.backlogSearchScheduler.action.search_backlog([self.show]) #@UndefinedVariable - ui.notifications.message('Show added/search', 'Adding and searching for episodes of' + msg) - else: - ui.notifications.message('Show added', 'Adding' + msg) - self.show.writeMetadata() self.show.updateMetadata() self.show.populateCache() @@ -495,6 +486,17 @@ class QueueItemAdd(ShowQueueItem): # update internal name cache name_cache.buildNameCache(self.show) + self.show.loadEpisodesFromDB() + + msg = ' the specified show into ' + self.showDir + # if started with WANTED eps then run the backlog + if WANTED == self.default_status or items_wanted: + logger.log('Launching backlog for this show since episodes are WANTED') + sickbeard.backlogSearchScheduler.action.search_backlog([self.show]) #@UndefinedVariable + ui.notifications.message('Show added/search', 'Adding and searching for episodes of' + msg) + else: + ui.notifications.message('Show added', 'Adding' + msg) + self.finish() def _finishEarly(self):