Merge pull request #915 from JackDandy/feature/AddLimitWebDLProper

Add option to limit WebDL propers to original release group...
This commit is contained in:
JackDandy 2017-02-17 05:40:07 +00:00 committed by GitHub
commit 7f03954d50
5 changed files with 38 additions and 17 deletions

View file

@ -46,6 +46,7 @@
* Add detection of '1080p Remux' releases as fullhdbluray * Add detection of '1080p Remux' releases as fullhdbluray
* Add "Perform search tasks" to Config/Media Providers/Options * Add "Perform search tasks" to Config/Media Providers/Options
* Change improve clarity of enabled providers on Config/Media Providers * Change improve clarity of enabled providers on Config/Media Providers
* Add option to limit WebDL propers to original release group under Config/Search/Media Search
* Change add IPv4 config option when enabling IPv6. * Change add IPv4 config option when enabling IPv6.

View file

@ -57,6 +57,15 @@
</label> </label>
</div> </div>
<div id="content_download_propers"> <div id="content_download_propers">
<div class="field-pair">
<label>
<span class="component-title">Limit WebDL propers</span>
<span class="component-desc">
<input type="checkbox" name="propers_webdl_onegrp"#echo ('', $html_checked)[$sickbeard.PROPERS_WEBDL_ONEGRP]#>
<p>Only allow WebDL 'Propers' from the original release group</p>
</span>
</label>
</div>
<div class="field-pair"> <div class="field-pair">
<label for="check_propers_interval"> <label for="check_propers_interval">
<span class="component-title">Check propers every:</span> <span class="component-title">Check propers every:</span>

View file

@ -200,6 +200,7 @@ TORRENT_METHOD = None
TORRENT_DIR = None TORRENT_DIR = None
DOWNLOAD_PROPERS = False DOWNLOAD_PROPERS = False
CHECK_PROPERS_INTERVAL = None CHECK_PROPERS_INTERVAL = None
PROPERS_WEBDL_ONEGRP = True
ALLOW_HIGH_PRIORITY = False ALLOW_HIGH_PRIORITY = False
NEWZNAB_DATA = '' NEWZNAB_DATA = ''
@ -551,7 +552,7 @@ def initialize(console_logging=True):
global BRANCH, CUR_COMMIT_BRANCH, GIT_REMOTE, CUR_COMMIT_HASH, GIT_PATH, CPU_PRESET, ANON_REDIRECT, \ global BRANCH, CUR_COMMIT_BRANCH, GIT_REMOTE, CUR_COMMIT_HASH, GIT_PATH, CPU_PRESET, ANON_REDIRECT, \
ENCRYPTION_VERSION, PROXY_SETTING, PROXY_INDEXERS, FILE_LOGGING_PRESET ENCRYPTION_VERSION, PROXY_SETTING, PROXY_INDEXERS, FILE_LOGGING_PRESET
# Search Settings/Episode # Search Settings/Episode
global DOWNLOAD_PROPERS, CHECK_PROPERS_INTERVAL, RECENTSEARCH_FREQUENCY, \ global DOWNLOAD_PROPERS, PROPERS_WEBDL_ONEGRP, CHECK_PROPERS_INTERVAL, RECENTSEARCH_FREQUENCY, \
BACKLOG_DAYS, BACKLOG_NOFULL, BACKLOG_FREQUENCY, USENET_RETENTION, IGNORE_WORDS, REQUIRE_WORDS, \ BACKLOG_DAYS, BACKLOG_NOFULL, BACKLOG_FREQUENCY, USENET_RETENTION, IGNORE_WORDS, REQUIRE_WORDS, \
ALLOW_HIGH_PRIORITY, SEARCH_UNAIRED, UNAIRED_RECENT_SEARCH_ONLY ALLOW_HIGH_PRIORITY, SEARCH_UNAIRED, UNAIRED_RECENT_SEARCH_ONLY
# Search Settings/NZB search # Search Settings/NZB search
@ -788,6 +789,7 @@ def initialize(console_logging=True):
TORRENT_METHOD = 'blackhole' TORRENT_METHOD = 'blackhole'
DOWNLOAD_PROPERS = bool(check_setting_int(CFG, 'General', 'download_propers', 1)) DOWNLOAD_PROPERS = bool(check_setting_int(CFG, 'General', 'download_propers', 1))
PROPERS_WEBDL_ONEGRP = bool(check_setting_int(CFG, 'General', 'propers_webdl_onegrp', 1))
CHECK_PROPERS_INTERVAL = check_setting_str(CFG, 'General', 'check_propers_interval', '') CHECK_PROPERS_INTERVAL = check_setting_str(CFG, 'General', 'check_propers_interval', '')
if CHECK_PROPERS_INTERVAL not in ('15m', '45m', '90m', '4h', 'daily'): if CHECK_PROPERS_INTERVAL not in ('15m', '45m', '90m', '4h', 'daily'):
CHECK_PROPERS_INTERVAL = 'daily' CHECK_PROPERS_INTERVAL = 'daily'
@ -1469,6 +1471,7 @@ def save_config():
new_config['General']['backlog_frequency'] = int(BACKLOG_FREQUENCY) new_config['General']['backlog_frequency'] = int(BACKLOG_FREQUENCY)
new_config['General']['update_frequency'] = int(UPDATE_FREQUENCY) new_config['General']['update_frequency'] = int(UPDATE_FREQUENCY)
new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS) new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS)
new_config['General']['propers_webdl_onegrp'] = int(PROPERS_WEBDL_ONEGRP)
new_config['General']['check_propers_interval'] = CHECK_PROPERS_INTERVAL new_config['General']['check_propers_interval'] = CHECK_PROPERS_INTERVAL
new_config['General']['allow_high_priority'] = int(ALLOW_HIGH_PRIORITY) new_config['General']['allow_high_priority'] = int(ALLOW_HIGH_PRIORITY)
new_config['General']['recentsearch_startup'] = int(RECENTSEARCH_STARTUP) new_config['General']['recentsearch_startup'] = int(RECENTSEARCH_STARTUP)

View file

@ -87,7 +87,8 @@ def _get_proper_list(aired_since_shows, recent_shows, recent_anime):
logger.log(u'Searching for new PROPER releases') logger.log(u'Searching for new PROPER releases')
try: try:
found_propers = cur_provider.find_propers(search_date=aired_since_shows, shows=recent_shows, anime=recent_anime) found_propers = cur_provider.find_propers(search_date=aired_since_shows, shows=recent_shows,
anime=recent_anime)
except exceptions.AuthException as e: except exceptions.AuthException as e:
logger.log(u'Authentication error: ' + ex(e), logger.ERROR) logger.log(u'Authentication error: ' + ex(e), logger.ERROR)
continue continue
@ -115,7 +116,7 @@ def _get_proper_list(aired_since_shows, recent_shows, recent_anime):
count += 1 count += 1
except (InvalidNameException, InvalidShowException): except (InvalidNameException, InvalidShowException):
continue continue
except Exception: except (StandardError, Exception):
continue continue
cur_provider.log_result('Propers', count, '%s' % cur_provider.name) cur_provider.log_result('Propers', count, '%s' % cur_provider.name)
@ -166,7 +167,8 @@ def _get_proper_list(aired_since_shows, recent_shows, recent_anime):
# check if we actually want this proper (if it's the right quality) # check if we actually want this proper (if it's the right quality)
my_db = db.DBConnection() my_db = db.DBConnection()
sql_results = my_db.select('SELECT status FROM tv_episodes WHERE showid = ? AND season = ? AND episode = ?', sql_results = my_db.select(
'SELECT release_group, status, version FROM tv_episodes WHERE showid = ? AND season = ? AND episode = ?',
[cur_proper.indexerid, cur_proper.season, cur_proper.episode]) [cur_proper.indexerid, cur_proper.season, cur_proper.episode])
if not sql_results: if not sql_results:
continue continue
@ -177,24 +179,28 @@ def _get_proper_list(aired_since_shows, recent_shows, recent_anime):
or cur_proper.quality != old_quality: or cur_proper.quality != old_quality:
continue continue
old_release_group = sql_results[0]['release_group']
log_same_grp = 'Skipping proper from release group: [%s], does not match existing release group: [%s] for [%s]'\
% (cur_proper.release_group, old_release_group, cur_proper.name)
# for webldls, prevent propers from different groups
if sickbeard.PROPERS_WEBDL_ONEGRP and \
old_quality in (Quality.HDWEBDL, Quality.FULLHDWEBDL, Quality.UHD4KWEB) and \
cur_proper.release_group != old_release_group:
logger.log(log_same_grp, logger.DEBUG)
continue
# check if we actually want this proper (if it's the right release group and a higher version) # check if we actually want this proper (if it's the right release group and a higher version)
if parse_result.is_anime: if parse_result.is_anime:
my_db = db.DBConnection()
sql_results = my_db.select(
'SELECT release_group, version FROM tv_episodes WHERE showid = ? AND season = ? AND episode = ?',
[cur_proper.indexerid, cur_proper.season, cur_proper.episode])
old_version = int(sql_results[0]['version']) old_version = int(sql_results[0]['version'])
old_release_group = (sql_results[0]['release_group'])
if -1 < old_version < cur_proper.version: if -1 < old_version < cur_proper.version:
logger.log(u'Found new anime v%s to replace existing v%s' % (cur_proper.version, old_version)) logger.log(u'Found new anime v%s to replace existing v%s' % (cur_proper.version, old_version))
else: else:
continue continue
if cur_proper.release_group != old_release_group: if cur_proper.release_group != old_release_group:
logger.log(u'Skipping proper from release group: %s, does not match existing release group: %s' % logger.log(log_same_grp, logger.DEBUG)
(cur_proper.release_group, old_release_group))
continue continue
# if the show is in our list and there hasn't been a proper already added for that particular episode # if the show is in our list and there hasn't been a proper already added for that particular episode
@ -313,7 +319,7 @@ def _get_last_proper_search():
try: try:
last_proper_search = datetime.date.fromordinal(int(sql_results[0]['last_proper_search'])) last_proper_search = datetime.date.fromordinal(int(sql_results[0]['last_proper_search']))
except: except (StandardError, Exception):
return datetime.date.fromordinal(1) return datetime.date.fromordinal(1)
return last_proper_search return last_proper_search

View file

@ -4793,11 +4793,12 @@ class ConfigSearch(Config):
nzbget_category=None, nzbget_priority=None, nzbget_host=None, nzbget_use_https=None, nzbget_category=None, nzbget_priority=None, nzbget_host=None, nzbget_use_https=None,
backlog_days=None, backlog_frequency=None, search_unaired=None, unaired_recent_search_only=None, backlog_days=None, backlog_frequency=None, search_unaired=None, unaired_recent_search_only=None,
recentsearch_frequency=None, nzb_method=None, torrent_method=None, usenet_retention=None, recentsearch_frequency=None, nzb_method=None, torrent_method=None, usenet_retention=None,
download_propers=None, check_propers_interval=None, allow_high_priority=None, download_propers=None, propers_webdl_onegrp=None, check_propers_interval=None,
allow_high_priority=None,
torrent_dir=None, torrent_username=None, torrent_password=None, torrent_host=None, torrent_dir=None, torrent_username=None, torrent_password=None, torrent_host=None,
torrent_label=None, torrent_path=None, torrent_verify_cert=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,
backlog_nofull=None): ignore_words=None, require_words=None, backlog_nofull=None):
results = [] results = []
@ -4830,6 +4831,7 @@ class ConfigSearch(Config):
sickbeard.REQUIRE_WORDS = require_words if require_words else '' sickbeard.REQUIRE_WORDS = require_words if require_words else ''
sickbeard.DOWNLOAD_PROPERS = config.checkbox_to_value(download_propers) sickbeard.DOWNLOAD_PROPERS = config.checkbox_to_value(download_propers)
sickbeard.PROPERS_WEBDL_ONEGRP = config.checkbox_to_value(propers_webdl_onegrp)
if sickbeard.CHECK_PROPERS_INTERVAL != check_propers_interval: if sickbeard.CHECK_PROPERS_INTERVAL != check_propers_interval:
sickbeard.CHECK_PROPERS_INTERVAL = check_propers_interval sickbeard.CHECK_PROPERS_INTERVAL = check_propers_interval