Commit 7d0057f9 authored by echel0n's avatar echel0n
Browse files

Release v9.2.21

parent d12d9cae
# Changelog
- * d8cff70 - 2017-11-27: Release v9.2.20
- * 2fead71 - 2017-11-27: Release v9.2.21
- * 5ce3b85 - 2017-11-27: Release v9.2.20
- * 31c5977 - 2017-11-27: Release v9.2.19
- * 7015df3 - 2017-11-27: switched to using poster thumbs for poster view on shows page
- * 2028c51 - 2017-11-27: Release v9.2.18
......
......@@ -60,7 +60,7 @@ from sickrage.core.queues.search import SearchQueue
from sickrage.core.queues.show import ShowQueue
from sickrage.core.searchers.backlog_searcher import BacklogSearcher
from sickrage.core.searchers.daily_searcher import DailySearcher
from sickrage.core.searchers.failed_searcher import FailedSearcher
from sickrage.core.searchers.failed_snatch_searcher import FailedSnatchSearcher
from sickrage.core.searchers.proper_searcher import ProperSearcher
from sickrage.core.searchers.subtitle_searcher import SubtitleSearcher
from sickrage.core.searchers.trakt_searcher import TraktSearcher
......@@ -177,7 +177,7 @@ class Core(object):
self.version_updater = VersionUpdater()
self.show_updater = ShowUpdater()
self.daily_searcher = DailySearcher()
self.failed_searcher = FailedSearcher()
self.failed_snatch_searcher = FailedSnatchSearcher()
self.backlog_searcher = BacklogSearcher()
self.proper_searcher = ProperSearcher()
self.trakt_searcher = TraktSearcher()
......@@ -370,15 +370,15 @@ class Core(object):
id=self.daily_searcher.name
)
# add failed search job
# add failed snatch search job
self.scheduler.add_job(
self.failed_searcher.run,
self.failed_snatch_searcher.run,
IntervalTrigger(
hours=1,
start_date=datetime.datetime.now() + datetime.timedelta(minutes=4)
),
name=self.failed_searcher.name,
id=self.failed_searcher.name
name=self.failed_snatch_searcher.name,
id=self.failed_snatch_searcher.name
)
# add backlog search job
......@@ -456,6 +456,11 @@ class Core(object):
self.scheduler.get_job(self.auto_postprocessor.name).resume
)[self.config.process_automatically]()
# Pause/Resume FAILEDSNATCHSEARCHER job
(self.scheduler.get_job(self.failed_snatch_searcher.name).pause,
self.scheduler.get_job(self.failed_snatch_searcher.name).resume
)[self.config.use_failed_snatcher]()
# start queue's
self.search_queue.start()
self.show_queue.start()
......
......@@ -435,6 +435,8 @@ class Config(object):
self.version_updater_freq = None
self.subtitle_searcher_freq = None
self.showupdate_hour = None
self.use_failed_snatcher = False
self.failed_snatch_age = None
self.quality_sizes = {}
......@@ -852,6 +854,7 @@ class Config(object):
'delete_failed': False
},
'FailedSnatches': {
'use_failed_snatcher': False,
'failed_snatch_age': 2
},
'NMJ': {
......@@ -1267,6 +1270,17 @@ class Config(object):
job = sickrage.app.scheduler.get_job(sickrage.app.auto_postprocessor.name)
(job.pause, job.resume)[self.process_automatically]()
def change_use_failed_snatcher(self, use_failed_snatcher):
"""
Enable/disable failed snatch searcher job
TODO: Make this return true/false on success/failure
:param failed_snatch_searcher: New desired state
"""
self.use_failed_snatcher = checkbox_to_value(use_failed_snatcher)
job = sickrage.app.scheduler.get_job(sickrage.app.failed_snatch_searcher.name)
(job.pause, job.resume)[self.use_failed_snatcher]()
################################################################################
# check_setting_int #
################################################################################
......@@ -1815,6 +1829,7 @@ class Config(object):
self.delete_failed = self.check_setting_bool('FailedDownloads', 'delete_failed')
# FAILED SNATCH SETTINGS
self.use_failed_snatcher = self.check_setting_bool('FailedSnatches', 'use_failed_snatcher')
self.failed_snatch_age = self.check_setting_int('FailedSnatches', 'failed_snatch_age')
# ANIDB SETTINGS
......@@ -2300,6 +2315,7 @@ class Config(object):
'delete_failed': int(self.delete_failed),
},
'FailedSnatches': {
'use_failed_snatcher': int(self.use_failed_snatcher),
'failed_snatch_age': int(self.failed_snatch_age),
},
'ANIDB': {
......
......@@ -30,9 +30,9 @@ from sickrage.core.tv.episode import TVEpisode
from sickrage.core.tv.show.history import FailedHistory, History
class FailedSearcher(object):
class FailedSnatchSearcher(object):
def __init__(self):
self.name = "FAILEDSEARCHER"
self.name = "FAILEDSNATCHSEARCHER"
self.lock = threading.Lock()
self.amActive = False
......@@ -60,7 +60,7 @@ class FailedSearcher(object):
snatched_episodes = [x['doc'] for x in sickrage.app.main_db.db.all('history', with_doc=True)
if x['doc']['action'] in Quality.SNATCHED + Quality.SNATCHED_BEST + Quality.SNATCHED_PROPER
and 24 >= int((datetime.datetime.now() - datetime.datetime.strptime(x['doc']['date'],
History.date_format)).total_seconds() / 3600) >= sickrage.app.config.failed_searcher_freq]
History.date_format)).total_seconds() / 3600) >= sickrage.app.config.failed_snatch_age]
downloaded_releases = [(x['doc']['showid'], x['doc']['season'], x['doc']['episode']) for x in
sickrage.app.main_db.db.all('history', with_doc=True)
......
......@@ -4008,7 +4008,7 @@ class ConfigSearch(Config):
nzbget_host=None, nzbget_use_https=None, backlog_frequency=None,
dailysearch_frequency=None, nzb_method=None, torrent_method=None, usenet_retention=None,
download_propers=None, check_propers_interval=None, allow_high_priority=None, sab_forced=None,
randomize_providers=None, failed_snatch_age=None,
randomize_providers=None, use_failed_snatcher=None, failed_snatch_age=None,
torrent_dir=None, torrent_username=None, torrent_password=None, torrent_host=None,
torrent_label=None, torrent_label_anime=None, torrent_path=None, torrent_verify_cert=None,
torrent_seed_time=None, torrent_paused=None, torrent_high_bandwidth=None,
......@@ -4024,9 +4024,10 @@ class ConfigSearch(Config):
if not sickrage.app.config.change_torrent_dir(torrent_dir):
results += [_("Unable to create directory ") + os.path.normpath(torrent_dir) + _(", dir not changed.")]
sickrage.app.config.change_use_failed_snatcher(use_failed_snatcher)
sickrage.app.config.change_failed_snatch_age(failed_snatch_age)
sickrage.app.config.change_daily_searcher_freq(dailysearch_frequency)
sickrage.app.config.change_backlog_searcher_freq(backlog_frequency)
sickrage.app.config.change_failed_snatch_age(failed_snatch_age)
sickrage.app.config.use_nzbs = checkbox_to_value(use_nzbs)
sickrage.app.config.use_torrents = checkbox_to_value(use_torrents)
sickrage.app.config.nzb_method = nzb_method
......
......@@ -77,6 +77,44 @@
</label>
</div>
</div>
<div class="row field-pair">
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
<label class="component-title">${_('Enable failed snatch handling')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 col-xs-12 component-desc">
<input type="checkbox" name="use_failed_snatcher" id="use_failed_snatcher"
class="enabler" ${('', 'checked')[bool(sickrage.app.config.use_failed_snatcher)]}/>
<label for="use_failed_snatcher">
<p>${_('enables/disables failed snatch handling, automatically retries failed snatches')}</p>
</label>
</div>
</div>
<div id="content_use_failed_snatcher">
<div class="row field-pair">
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
<label class="component-title">${_('Check for failed snatches aged')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 col-xs-12 component-desc">
<div class="input-group input350">
<div class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</div>
<input name="failed_snatch_age"
id="failed_snatch_age"
value="${sickrage.app.config.failed_snatch_age}"
placeholder="${_('time in hours')}"
title="minimum allowed time ${sickrage.app.config.min_failed_snatch_age} hours"
class="form-control"/>
<div class="input-group-addon">
hours
</div>
</div>
</div>
</div>
</div>
<div id="content_download_propers">
<div class="row field-pair">
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
......@@ -99,28 +137,6 @@
</div>
</div>
<div class="row field-pair">
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
<label class="component-title">${_('Check for failed snatches aged')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 col-xs-12 component-desc">
<div class="input-group input350">
<div class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</div>
<input name="failed_snatch_age"
id="failed_snatch_age"
value="${sickrage.app.config.failed_snatch_age}"
placeholder="${_('time in hours')}"
title="minimum allowed time ${sickrage.app.config.min_failed_snatch_age} hours"
class="form-control"/>
<div class="input-group-addon">
hours
</div>
</div>
</div>
</div>
<div class="row field-pair">
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
<label class="component-title">${_('Backlog search frequency')}</label>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment