1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Added global indexer timeout for adding shows.

This commit is contained in:
echel0n 2014-05-21 11:17:52 -07:00
parent 3a874b56dd
commit 63207ba93b
5 changed files with 27 additions and 6 deletions

View File

@ -121,10 +121,21 @@
</span>
</label>
</div>
<div class="field-pair">
<label class="nocheck clearfix">
<span class="component-title">Indexer Timeout:</span>
<input type="text" name="indexer_timeout" id="indexer_timeout" value="$sickbeard.INDEXER_TIMEOUT" size="5" />
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">Time in seconds before Indexer search times out for adding shows (eg. 10)</span>
</label>
</div>
<div class="field-pair">
<label class="nocheck clearfix" for="log_dir">
<span class="component-title">Logging Directory</span>
<span class="component-title">Logging Director:y</span>
<input type="text" name="log_dir" id="log_dir" value="$sickbeard.ACTUAL_LOG_DIR" size="40" />
</label>
</div>
@ -132,7 +143,7 @@
<div class="field-pair">
<input type="checkbox" name="handle_reverse_proxy" id="handle_reverse_proxy" #if $sickbeard.HANDLE_REVERSE_PROXY then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="handle_reverse_proxy">
<span class="component-title">Handle reverse proxies</span>
<span class="component-title">Handle reverse proxies:</span>
<span class="component-desc">Should Sick Beard accept reverse proxy headers? (X-Forwarded-Host, X-Forwarded-For, X-Forwarded-Proto)</span>
</label>
</div>

View File

@ -30,6 +30,8 @@
<legend class="legendStep">Find a show on the TVDB or TVRAGE</legend>
<div class="stepDiv">
<input type="hidden" name="indexer_timeout" id="indexer_timeout" value="$sickbeard.INDEXER_TIMEOUT" />
#if $use_provided_info:
Show retrieved from existing metadata: <a href="$sickbeard.indexerApi($provided_indexer).config["show_url"]$provided_indexer_id">$provided_indexer_name</a>
<input type="hidden" name="indexerLang" value="en" />

View File

@ -41,10 +41,11 @@ $(document).ready(function () {
var searchingFor = $('#nameToSearch').val() + ' on ' + $('#providedIndexer option:selected').text() + ' in ' + $('#indexerLangSelect').val();
$('#searchResults').empty().html('<img id="searchingAnim" src="' + sbRoot + '/images/loading32.gif" height="32" width="32" /> searching ' + searchingFor + '...');
var indexerTimeout = parseInt($('#indexer_timeout').val(), 10);
searchRequestXhr = $.ajax({
url: sbRoot + '/home/addShows/searchIndexersForShowName',
data: {'search_term': $('#nameToSearch').val(), 'lang': $('#indexerLangSelect').val(), 'indexer': $('#providedIndexer').val()},
timeout: 10000,
timeout: indexerTimeout * 1000,
dataType: 'json',
error: function () {
$('#searchResults').empty().html('search timed out, try again or try another indexer');

View File

@ -159,6 +159,7 @@ STATUS_DEFAULT = None
FLATTEN_FOLDERS_DEFAULT = None
SUBTITLES_DEFAULT = None
INDEXER_DEFAULT = None
INDEXER_TIMEOUT = None
PROVIDER_ORDER = []
NAMING_MULTI_EP = None
@ -430,7 +431,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, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, BACKLOG_STARTUP, SKIP_REMOVED_FILES, \
showUpdateScheduler, __INITIALIZED__, LAUNCH_BROWSER, UPDATE_SHOWS_ON_START, SORT_ARTICLE, showList, loadingShowList, \
NEWZNAB_DATA, NZBS, NZBS_UID, NZBS_HASH, INDEXER_DEFAULT, USENET_RETENTION, TORRENT_DIR, \
NEWZNAB_DATA, NZBS, NZBS_UID, NZBS_HASH, INDEXER_DEFAULT, INDEXER_TIMEOUT, USENET_RETENTION, TORRENT_DIR, \
QUALITY_DEFAULT, FLATTEN_FOLDERS_DEFAULT, SUBTITLES_DEFAULT, STATUS_DEFAULT, DAILYSEARCH_STARTUP, \
GROWL_NOTIFY_ONSNATCH, GROWL_NOTIFY_ONDOWNLOAD, GROWL_NOTIFY_ONSUBTITLEDOWNLOAD, TWITTER_NOTIFY_ONSNATCH, TWITTER_NOTIFY_ONDOWNLOAD, TWITTER_NOTIFY_ONSUBTITLEDOWNLOAD, \
USE_GROWL, GROWL_HOST, GROWL_PASSWORD, USE_PROWL, PROWL_NOTIFY_ONSNATCH, PROWL_NOTIFY_ONDOWNLOAD, PROWL_NOTIFY_ONSUBTITLEDOWNLOAD, PROWL_API, PROWL_PRIORITY, PROG_DIR, \
@ -567,6 +568,7 @@ def initialize(consoleLogging=True):
AUTO_UPDATE = check_setting_int(CFG, 'General', 'auto_update', 0)
FLATTEN_FOLDERS_DEFAULT = bool(check_setting_int(CFG, 'General', 'flatten_folders_default', 0))
INDEXER_DEFAULT = check_setting_int(CFG, 'General', 'indexer_default', 0)
INDEXER_TIMEOUT = check_setting_int(CFG, 'General', 'indexer_timeout', 10)
PROVIDER_ORDER = check_setting_str(CFG, 'General', 'provider_order', '').split()
@ -1349,6 +1351,7 @@ def save_config():
new_config['General']['status_default'] = int(STATUS_DEFAULT)
new_config['General']['flatten_folders_default'] = int(FLATTEN_FOLDERS_DEFAULT)
new_config['General']['indexer_default'] = int(INDEXER_DEFAULT)
new_config['General']['indexer_timeout'] = int(INDEXER_TIMEOUT)
new_config['General']['provider_order'] = ' '.join(PROVIDER_ORDER)
new_config['General']['version_notify'] = int(VERSION_NOTIFY)
new_config['General']['auto_update'] = int(AUTO_UPDATE)

View File

@ -1014,7 +1014,8 @@ class ConfigGeneral:
use_api=None, api_key=None, indexer_default=None, timezone_display=None, cpu_preset=None,
web_password=None, version_notify=None, enable_https=None, https_cert=None, https_key=None,
handle_reverse_proxy=None, sort_article=None, auto_update=None, proxy_setting=None,
anon_redirect=None, git_path=None, calendar_unprotected=None, date_preset=None, time_preset=None):
anon_redirect=None, git_path=None, calendar_unprotected=None, date_preset=None, time_preset=None,
indexer_timeout=None):
results = []
@ -1048,6 +1049,9 @@ class ConfigGeneral:
if indexer_default:
sickbeard.INDEXER_DEFAULT = config.to_int(indexer_default)
if indexer_timeout:
sickbeard.INDEXER_TIMEOUT = config.to_int(indexer_timeout)
if time_preset:
sickbeard.TIME_PRESET_W_SECONDS = time_preset
sickbeard.TIME_PRESET = sickbeard.TIME_PRESET_W_SECONDS.replace(u":%S", u"")