diff --git a/CHANGES.md b/CHANGES.md
index 55f8cac5..8c7a8ef4 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -187,6 +187,7 @@
* Add Plex notifications secure connect where available (PMS 1.1.4.2757 and newer with username and password)
* Add if all torrent caches fail, save magnets from RARBG and TPB as files for clients (or plugins) that now support it
* Add advice to logs if all caches fail to switch to direct client connect instead of the basic blackhole method
+* Add search setting "Disable auto full backlog"
[develop changelog]
* Change send nzb data to NZBGet for Anizb instead of url
diff --git a/gui/slick/interfaces/default/config_search.tmpl b/gui/slick/interfaces/default/config_search.tmpl
index 41e57c38..8dc90750 100755
--- a/gui/slick/interfaces/default/config_search.tmpl
+++ b/gui/slick/interfaces/default/config_search.tmpl
@@ -52,7 +52,7 @@
Download propers
>
- replace original download with "Proper" or "Repack" if nuked
+ replace original download with 'Proper' or 'Repack' if nuked
@@ -93,6 +93,24 @@
+
+ Disable auto full backlog
+
+ >
+ backlog search manually by setting episodes 'Wanted' or via 'Backlog overview'
+
+
+
+
+
+
+ Backlog search spread
+
+ to access this setting, unselect "Disable auto full backlog " search above
+
+
+
+
Backlog search spread
@@ -116,7 +134,7 @@
Ignore result with any word
- (opt: start "regex:")
+ (opt: start 'regex:')
ignore search result if its title contains any of these comma seperated words
Shows with custom ignores
@@ -138,7 +156,7 @@
Require all these words
- (opt: start "regex:")
+ (opt: start 'regex:')
ignore search result unless its title contains all of these comma seperated words
Shows with custom requires
diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py
index 8dba0da0..04884748 100755
--- a/sickbeard/__init__.py
+++ b/sickbeard/__init__.py
@@ -210,6 +210,7 @@ UPDATE_FREQUENCY = None
RECENTSEARCH_STARTUP = False
BACKLOG_FREQUENCY = None
BACKLOG_STARTUP = False
+BACKLOG_NOFULL = False
DEFAULT_AUTOPOSTPROCESSER_FREQUENCY = 10
DEFAULT_RECENTSEARCH_FREQUENCY = 40
@@ -514,7 +515,7 @@ def initialize(consoleLogging=True):
USE_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, \
PLEX_UPDATE_LIBRARY, PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, \
USE_TRAKT, TRAKT_CONNECTED_ACCOUNT, TRAKT_ACCOUNTS, TRAKT_MRU, TRAKT_VERIFY, TRAKT_REMOVE_WATCHLIST, TRAKT_TIMEOUT, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktCheckerScheduler, TRAKT_SYNC, TRAKT_DEFAULT_INDEXER, TRAKT_REMOVE_SERIESLIST, TRAKT_UPDATE_COLLECTION, \
- BACKLOG_FREQUENCY, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, MAX_BACKLOG_FREQUENCY, BACKLOG_STARTUP, SKIP_REMOVED_FILES, \
+ BACKLOG_FREQUENCY, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, MAX_BACKLOG_FREQUENCY, BACKLOG_STARTUP, BACKLOG_NOFULL, SKIP_REMOVED_FILES, \
showUpdateScheduler, __INITIALIZED__, LAUNCH_BROWSER, TRASH_REMOVE_SHOW, TRASH_ROTATE_LOGS, HOME_SEARCH_FOCUS, SORT_ARTICLE, showList, loadingShowList, UPDATE_SHOWS_ON_START, SHOW_UPDATE_HOUR, \
NEWZNAB_DATA, INDEXER_DEFAULT, INDEXER_TIMEOUT, USENET_RETENTION, TORRENT_DIR, \
QUALITY_DEFAULT, FLATTEN_FOLDERS_DEFAULT, SUBTITLES_DEFAULT, STATUS_DEFAULT, WANTED_BEGIN_DEFAULT, WANTED_LATEST_DEFAULT, RECENTSEARCH_STARTUP, \
@@ -740,6 +741,7 @@ def initialize(consoleLogging=True):
RECENTSEARCH_STARTUP = bool(check_setting_int(CFG, 'General', 'recentsearch_startup', 0))
BACKLOG_STARTUP = bool(check_setting_int(CFG, 'General', 'backlog_startup', 0))
+ BACKLOG_NOFULL = bool(check_setting_int(CFG, 'General', 'backlog_nofull', 0))
SKIP_REMOVED_FILES = check_setting_int(CFG, 'General', 'skip_removed_files', 0)
USENET_RETENTION = check_setting_int(CFG, 'General', 'usenet_retention', 500)
@@ -1498,6 +1500,7 @@ def save_config():
new_config['General']['allow_high_priority'] = int(ALLOW_HIGH_PRIORITY)
new_config['General']['recentsearch_startup'] = int(RECENTSEARCH_STARTUP)
new_config['General']['backlog_startup'] = int(BACKLOG_STARTUP)
+ new_config['General']['backlog_nofull'] = int(BACKLOG_NOFULL)
new_config['General']['skip_removed_files'] = int(SKIP_REMOVED_FILES)
new_config['General']['quality_default'] = int(QUALITY_DEFAULT)
new_config['General']['status_default'] = int(STATUS_DEFAULT)
diff --git a/sickbeard/search_backlog.py b/sickbeard/search_backlog.py
index 615db1ef..202bf354 100644
--- a/sickbeard/search_backlog.py
+++ b/sickbeard/search_backlog.py
@@ -136,11 +136,11 @@ class BacklogSearcher:
if i % parts == 0:
p += 1
cl.append(['INSERT INTO backlogparts (part, indexerid, indexer) VALUES (?,?,?)',
- [p, s['indexerid'], s['indexer']]])
+ [p, s['indexerid'], s['indexer']]])
if 0 < len(cl):
my_db.mass_action(cl)
- except:
+ except (StandardError, Exception):
pass
def search_backlog(self, which_shows=None, force_type=NORMAL_BACKLOG, force=False):
@@ -157,13 +157,12 @@ class BacklogSearcher:
standard_backlog = True
now = datetime.datetime.now()
- torrent_only = continued_backlog = False
+ any_torrent_enabled = continued_backlog = False
if not force and standard_backlog and (datetime.datetime.now() - datetime.datetime.fromtimestamp(
self._get_last_runtime())) < datetime.timedelta(hours=23):
- if [x for x in sickbeard.providers.sortedProviderList() if x.is_active() and x.enable_backlog and
- x.providerType == GenericProvider.TORRENT]:
- torrent_only = True
- else:
+ any_torrent_enabled = any([x for x in sickbeard.providers.sortedProviderList() if x.is_active()
+ and x.enable_backlog and x.providerType == GenericProvider.TORRENT])
+ if not any_torrent_enabled:
logger.log('Last scheduled Backlog run was within the last day, skipping this run.', logger.DEBUG)
return
@@ -176,14 +175,17 @@ class BacklogSearcher:
limited_from_date = datetime.date.today() - datetime.timedelta(days=sickbeard.BACKLOG_DAYS)
limited_backlog = False
- if not which_shows and torrent_only:
+ if standard_backlog and (any_torrent_enabled or sickbeard.BACKLOG_NOFULL):
logger.log(u'Running limited backlog for episodes missed during the last %s day(s)' %
str(sickbeard.BACKLOG_DAYS))
from_date = limited_from_date
limited_backlog = True
runparts = []
- if standard_backlog and not torrent_only:
+ 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')
+
+ 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:
@@ -198,9 +200,7 @@ class BacklogSearcher:
continued_backlog = True
my_db.action('DELETE FROM backlogparts WHERE part = ?', [part_nr])
- forced = False
- if not which_shows and force_type != NORMAL_BACKLOG:
- forced = True
+ forced = standard_backlog and force_type != NORMAL_BACKLOG
wanted_list = []
for curShow in show_list:
@@ -211,7 +211,7 @@ class BacklogSearcher:
wanted_list.append(w)
parts = []
- if standard_backlog and not torrent_only and not continued_backlog:
+ if standard_backlog and not any_torrent_enabled and not continued_backlog and not sickbeard.BACKLOG_NOFULL:
fullbacklogparts = sum([len(w) for w in wanted_list if w]) // sickbeard.BACKLOG_FREQUENCY
h_part = []
counter = 0
@@ -238,7 +238,7 @@ class BacklogSearcher:
wanted_list = [w for w in wanted_list if w and in_showlist(w.itervalues().next()[0].show, runparts)]
limited_wanted_list = []
- if standard_backlog and not torrent_only and runparts:
+ if standard_backlog and not any_torrent_enabled and runparts:
for curShow in sickbeard.showList:
if not curShow.paused and not in_showlist(curShow, runparts):
w = wanted_episodes(curShow, limited_from_date, make_dict=True,
@@ -246,11 +246,11 @@ class BacklogSearcher:
if w:
limited_wanted_list.append(w)
- self.add_backlog_item(wanted_list, standard_backlog, limited_backlog, forced, torrent_only)
- if standard_backlog and not torrent_only and limited_wanted_list:
- self.add_backlog_item(limited_wanted_list, standard_backlog, True, forced, torrent_only)
+ self.add_backlog_item(wanted_list, standard_backlog, limited_backlog, forced, any_torrent_enabled)
+ if standard_backlog and not any_torrent_enabled and limited_wanted_list:
+ self.add_backlog_item(limited_wanted_list, standard_backlog, True, forced, any_torrent_enabled)
- if standard_backlog and not torrent_only and not continued_backlog:
+ if standard_backlog and not sickbeard.BACKLOG_NOFULL and not any_torrent_enabled and not continued_backlog:
cl = ([], [['DELETE FROM backlogparts']])[len(parts) > 1]
for i, l in enumerate(parts):
if 0 == i:
@@ -264,11 +264,11 @@ class BacklogSearcher:
# don't consider this an actual backlog search if we only did recent eps
# or if we only did certain shows
- if from_date == datetime.date.fromordinal(1) and not which_shows:
+ if from_date == datetime.date.fromordinal(1) and standard_backlog:
self._set_last_backlog(cur_date)
self._get_last_backlog()
- if standard_backlog and not torrent_only:
+ if standard_backlog and not any_torrent_enabled:
self._set_last_runtime(now)
self.amActive = False
diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py
index c6cc08c9..c6619a5a 100644
--- a/sickbeard/webserve.py
+++ b/sickbeard/webserve.py
@@ -4483,7 +4483,8 @@ class ConfigSearch(Config):
download_propers=None, check_propers_interval=None, allow_high_priority=None,
torrent_dir=None, torrent_username=None, torrent_password=None, torrent_host=None,
torrent_label=None, torrent_path=None, torrent_verify_cert=None,
- torrent_seed_time=None, torrent_paused=None, torrent_high_bandwidth=None, ignore_words=None, require_words=None):
+ torrent_seed_time=None, torrent_paused=None, torrent_high_bandwidth=None, ignore_words=None, require_words=None,
+ backlog_nofull=None):
results = []
@@ -4500,6 +4501,11 @@ class ConfigSearch(Config):
sickbeard.search_backlog.BacklogSearcher.change_backlog_parts(old_backlog_frequency, sickbeard.BACKLOG_FREQUENCY)
sickbeard.BACKLOG_DAYS = config.to_int(backlog_days, default=7)
+ sickbeard.BACKLOG_NOFULL = bool(config.checkbox_to_value(backlog_nofull))
+ if sickbeard.BACKLOG_NOFULL:
+ my_db = db.DBConnection('cache.db')
+ my_db.action('DELETE FROM backlogparts')
+
sickbeard.USE_NZBS = config.checkbox_to_value(use_nzbs)
sickbeard.USE_TORRENTS = config.checkbox_to_value(use_torrents)