1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-18 07:15:13 -05:00

Merge pull request #348 from WebSpider/dev-prefer_episode_dl

Add option to prefer episode downloading
This commit is contained in:
Nils 2014-05-04 23:40:25 +02:00
commit 3fbc888406
4 changed files with 20 additions and 7 deletions

View File

@ -89,6 +89,13 @@
<span class="component-desc">Set high priority for downloads of recently aired episodes?</span> <span class="component-desc">Set high priority for downloads of recently aired episodes?</span>
</label> </label>
</div> </div>
<div class="field-pair">
<input type="checkbox" name="prefer_episode_releases" id="prefer_episode_releases" #if $sickbeard.PREFER_EPISODE_RELEASES == True then "checked=\"checked\"" else ""# />
<label class="clearfix" for="prefer_episode_releases">
<span class="component title">Prefer episode download</span>
<span class="component-desc">Prefer to download seperate episodes, not complete seasons?</span>
</label>
</div>
<div class="clearfix"></div> <div class="clearfix"></div>
<input type="submit" class="btn config_submitter" value="Save Changes" /><br/> <input type="submit" class="btn config_submitter" value="Save Changes" /><br/>

View File

@ -167,6 +167,7 @@ USENET_RETENTION = None
TORRENT_METHOD = None TORRENT_METHOD = None
TORRENT_DIR = None TORRENT_DIR = None
DOWNLOAD_PROPERS = None DOWNLOAD_PROPERS = None
PREFER_EPISODE_RELEASES = None
ALLOW_HIGH_PRIORITY = None ALLOW_HIGH_PRIORITY = None
SEARCH_FREQUENCY = None SEARCH_FREQUENCY = None
@ -460,7 +461,7 @@ def initialize(consoleLogging=True):
with INIT_LOCK: with INIT_LOCK:
global ACTUAL_LOG_DIR, LOG_DIR, WEB_PORT, WEB_LOG, ENCRYPTION_VERSION, WEB_ROOT, WEB_USERNAME, WEB_PASSWORD, WEB_HOST, WEB_IPV6, USE_API, API_KEY, ENABLE_HTTPS, HTTPS_CERT, HTTPS_KEY, \ global ACTUAL_LOG_DIR, LOG_DIR, WEB_PORT, WEB_LOG, ENCRYPTION_VERSION, WEB_ROOT, WEB_USERNAME, WEB_PASSWORD, WEB_HOST, WEB_IPV6, USE_API, API_KEY, ENABLE_HTTPS, HTTPS_CERT, HTTPS_KEY, \
USE_NZBS, USE_TORRENTS, NZB_METHOD, NZB_DIR, DOWNLOAD_PROPERS, ALLOW_HIGH_PRIORITY, TORRENT_METHOD, \ USE_NZBS, USE_TORRENTS, NZB_METHOD, NZB_DIR, DOWNLOAD_PROPERS, PREFER_EPISODE_RELEASES, ALLOW_HIGH_PRIORITY, TORRENT_METHOD, \
SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_HOST, \ SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_HOST, \
NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_HOST, currentSearchScheduler, backlogSearchScheduler, \ NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_HOST, currentSearchScheduler, backlogSearchScheduler, \
TORRENT_USERNAME, TORRENT_PASSWORD, TORRENT_HOST, TORRENT_PATH, TORRENT_RATIO, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_LABEL, \ TORRENT_USERNAME, TORRENT_PASSWORD, TORRENT_HOST, TORRENT_PATH, TORRENT_RATIO, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_LABEL, \
@ -628,6 +629,8 @@ def initialize(consoleLogging=True):
DOWNLOAD_PROPERS = bool(check_setting_int(CFG, 'General', 'download_propers', 1)) DOWNLOAD_PROPERS = bool(check_setting_int(CFG, 'General', 'download_propers', 1))
PREFER_EPISODE_RELEASES = bool(check_setting_int(CFG, 'General', 'prefer_episode_releases', 0))
ALLOW_HIGH_PRIORITY = bool(check_setting_int(CFG, 'General', 'allow_high_priority', 1)) ALLOW_HIGH_PRIORITY = bool(check_setting_int(CFG, 'General', 'allow_high_priority', 1))
USENET_RETENTION = check_setting_int(CFG, 'General', 'usenet_retention', 500) USENET_RETENTION = check_setting_int(CFG, 'General', 'usenet_retention', 500)
@ -1318,6 +1321,7 @@ def save_config():
new_config['General']['search_frequency'] = int(SEARCH_FREQUENCY) new_config['General']['search_frequency'] = int(SEARCH_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']['prefer_episode_releases'] = int(PREFER_EPISODE_RELEASES
new_config['General']['allow_high_priority'] = int(ALLOW_HIGH_PRIORITY) new_config['General']['allow_high_priority'] = int(ALLOW_HIGH_PRIORITY)
new_config['General']['quality_default'] = int(QUALITY_DEFAULT) new_config['General']['quality_default'] = int(QUALITY_DEFAULT)
new_config['General']['status_default'] = int(STATUS_DEFAULT) new_config['General']['status_default'] = int(STATUS_DEFAULT)

View File

@ -435,11 +435,12 @@ def searchProviders(show, season, episodes, seasonSearch=False, manualSearch=Fal
else: else:
anyWanted = True anyWanted = True
# if we need every ep in the season and there's nothing better then just download this and be done with it # if we need every ep in the season check if single episode releases should be preferred over season releases (missing single episode releases will be picked individually from season release)
if allWanted and bestSeasonNZB.quality == highest_quality_overall: preferSingleEpisodesOverSeasonReleases = sickbeard.PREFER_EPISODE_RELEASES
logger.log( logger.log(u"Prefer single episodes over season releases: "+str(preferSingleEpisodesOverSeasonReleases), logger.DEBUG)
u"Every ep in this season is needed, downloading the whole " + bestSeasonNZB.provider.providerType + " " + bestSeasonNZB.name) # if we need every ep in the season and there's nothing better then just download this and be done with it (unless single episodes are preferred)
if allWanted and bestSeasonNZB.quality == highest_quality_overall and not preferSingleEpisodesOverSeasonReleases::
logger.log(u"Every ep in this season is needed, downloading the whole " + bestSeasonNZB.provider.providerType + " " + bestSeasonNZB.name)
epObjs = [] epObjs = []
for curEpNum in allEps: for curEpNum in allEps:
epObjs.append(show.getEpisode(season, curEpNum)) epObjs.append(show.getEpisode(season, curEpNum))

View File

@ -1056,7 +1056,7 @@ class ConfigSearch:
sab_apikey=None, sab_category=None, sab_host=None, nzbget_username=None, nzbget_password=None, sab_apikey=None, sab_category=None, sab_host=None, nzbget_username=None, nzbget_password=None,
nzbget_category=None, nzbget_host=None, nzbget_category=None, nzbget_host=None,
nzb_method=None, torrent_method=None, usenet_retention=None, search_frequency=None, nzb_method=None, torrent_method=None, usenet_retention=None, search_frequency=None,
download_propers=None, allow_high_priority=None, download_propers=None, prefer_episode_releases=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_label=None, torrent_path=None,
torrent_ratio=None, torrent_seed_time=None, torrent_paused=None, torrent_high_bandwidth=None, ignore_words=None): torrent_ratio=None, torrent_seed_time=None, torrent_paused=None, torrent_high_bandwidth=None, ignore_words=None):
@ -1086,6 +1086,7 @@ class ConfigSearch:
else: else:
sickbeard.properFinderScheduler.silent = True sickbeard.properFinderScheduler.silent = True
sickbeard.PREFER_EPISODE_RELEASES = config.checkbox_to_value(prefer_episode_releases)
sickbeard.ALLOW_HIGH_PRIORITY = config.checkbox_to_value(allow_high_priority) sickbeard.ALLOW_HIGH_PRIORITY = config.checkbox_to_value(allow_high_priority)
sickbeard.SAB_USERNAME = sab_username sickbeard.SAB_USERNAME = sab_username