mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-11 05:33:37 +00:00
Merge pull request #914 from JackDandy/feature/AddScheduledBacklogSwitch
Feature/Add scheduled backlog switch
This commit is contained in:
commit
0e9848c245
12 changed files with 161 additions and 102 deletions
|
@ -44,6 +44,8 @@
|
|||
* Add one time run to start up that deletes troublemaking compiled files
|
||||
* Fix reload of homepage after restart in some browsers
|
||||
* Add detection of '1080p Remux' releases as fullhdbluray
|
||||
* Add "Perform search tasks" to Config/Media Providers/Options
|
||||
* Change improve clarity of enabled providers on Config/Media Providers
|
||||
* Change add IPv4 config option when enabling IPv6.
|
||||
|
||||
|
||||
|
|
|
@ -646,6 +646,10 @@ config*.tmpl
|
|||
color:#ddd
|
||||
}
|
||||
|
||||
.provider-enabled{
|
||||
box-shadow:-26px 0 0 0 rgb(21, 82, 143) inset
|
||||
}
|
||||
|
||||
#service_order_list li{
|
||||
background:#333 !important;
|
||||
}
|
||||
|
|
|
@ -631,6 +631,10 @@ config*.tmpl
|
|||
border:1px dotted #ccc
|
||||
}
|
||||
|
||||
.provider-enabled{
|
||||
box-shadow:-26px 0 0 0 rgb(199, 219, 64) inset
|
||||
}
|
||||
|
||||
.infoTableSeperator{
|
||||
border-top:1px dotted #666
|
||||
}
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
|
||||
<div id="config-components">
|
||||
<ul>
|
||||
<li><a href="#core-component-group1">Provider Priorities</a></li>
|
||||
<li><a href="#core-component-group2">Provider Options</a></li>
|
||||
<li><a href="#core-component-group1">Priorities</a></li>
|
||||
<li><a href="#core-component-group2">Options</a></li>
|
||||
|
||||
#if $sickbeard.USE_NZBS
|
||||
<li><a href="#core-component-group3">Custom Newznab</a></li>
|
||||
|
@ -86,9 +86,9 @@
|
|||
<div id="core-component-group1" class="component-group">
|
||||
<fieldset class="component-group-list">
|
||||
<div class="component-group-desc">
|
||||
<h3>Provider Priorities</h3>
|
||||
<h3>Priorities</h3>
|
||||
<p>Allows searching recent and past releases.</p>
|
||||
<p>Check off and drag the providers into the order you want them to be used.</p>
|
||||
<p>Check off and drag providers into the order you want them to be used.</p>
|
||||
<p>At least one provider is required, two are recommended.</p>
|
||||
|
||||
#if $methods_notused
|
||||
|
@ -110,7 +110,7 @@
|
|||
#set $tip = ($cur_provider.name + ('', ' (enable for link)')[not $cur_url and not cur_provider.is_enabled()],
|
||||
'Site Down')[$bad_url]
|
||||
#set $state = ('', ' <span class="red-text">(Site Down?)</span>')[$bad_url]
|
||||
<li class="ui-state-default row-#echo ('odd', 'even')[$show_type or not $sickbeard.USE_TORRENTS]#" id="$cur_name">
|
||||
<li class="ui-state-default row-#echo ('odd', 'even')[$show_type or not $sickbeard.USE_TORRENTS]##echo ('', ' provider-enabled')[$cur_provider.is_enabled()]#" id="$cur_name">
|
||||
<input type="checkbox" id="enable_$cur_name" class="provider_enabler" <%= html_checked if cur_provider.is_enabled() else '' %>/>
|
||||
<a class="imgLink" #if $cur_url#href="<%= anon_url(cur_url) %>" onclick="window.open(this.href,'_blank');return false;"#else#name=""#end if# rel="noreferrer"><img src="$sbRoot/images/providers/$cur_provider.image_name()" alt="$tip" title="$tip" width="16" height="16" style="vertical-align:middle" /></a>
|
||||
<span style="vertical-align:middle">$cur_provider.name$state</span>
|
||||
|
@ -150,8 +150,8 @@
|
|||
<div id="core-component-group2" class="component-group">
|
||||
|
||||
<div class="component-group-desc">
|
||||
<h3>Provider Options</h3>
|
||||
<p>Configure individual provider settings here.</p>
|
||||
<h3>Options</h3>
|
||||
<p>Individual provider settings.</p>
|
||||
</div>
|
||||
|
||||
<fieldset class="component-group-list">
|
||||
|
@ -196,8 +196,41 @@
|
|||
</div>
|
||||
|
||||
<!-- start div for editing providers //-->
|
||||
#set $recentsearch_tip = 'match recent episodes from results of latest releases'
|
||||
#set $backlogsearch_tip = 'allow active searching for individual episode releases'
|
||||
#set $scheduled_backlog_tip = 'enable scheduled searching for backlogged episodes'
|
||||
#for $cur_newznab_provider in [$cur_provider for $cur_provider in $sickbeard.newznabProviderList]
|
||||
<div class="providerDiv" id="${cur_newznab_provider.get_id()}Div">
|
||||
#set $can_recent = $hasattr($cur_newznab_provider, 'enable_recentsearch')
|
||||
#set $can_backlog = $hasattr($cur_newznab_provider, 'enable_backlog')
|
||||
#set $can_schedule_backlog = $hasattr($cur_newznab_provider, 'enable_scheduled_backlog')
|
||||
#if $cur_newznab_provider.supports_backlog and ($can_recent or $can_backlog or $can_schedule_backlog)
|
||||
<div class="field-pair">
|
||||
<span class="component-title">Perform search tasks</span>
|
||||
<span class="component-desc">
|
||||
#if $can_recent
|
||||
<label for="${cur_newznab_provider.get_id()}_enable_recentsearch" style="display:inline">
|
||||
<input type="checkbox" name="${cur_newznab_provider.get_id()}_enable_recentsearch" id="${cur_newznab_provider.get_id()}_enable_recentsearch" <%= html_checked if cur_newznab_provider.enable_recentsearch else '' %>/>
|
||||
<p>$recentsearch_tip</p>
|
||||
</label>
|
||||
#end if
|
||||
#if $can_backlog
|
||||
<label for="${cur_newznab_provider.get_id()}_enable_backlog" style="display:inline">
|
||||
<input class="enabler" type="checkbox" name="${cur_newznab_provider.get_id()}_enable_backlog" id="${cur_newznab_provider.get_id()}_enable_backlog" <%= html_checked if cur_newznab_provider.enable_backlog else '' %>/>
|
||||
<p>$backlogsearch_tip</p>
|
||||
</label>
|
||||
#end if
|
||||
#if $can_schedule_backlog
|
||||
<div id="content_${cur_newznab_provider.get_id()}_enable_backlog">
|
||||
<label for="${cur_newznab_provider.get_id()}_enable_scheduled_backlog" style="display:inline">
|
||||
<input type="checkbox" name="${cur_newznab_provider.get_id()}_enable_scheduled_backlog" id="${cur_newznab_provider.get_id()}_enable_scheduled_backlog" <%= html_checked if cur_newznab_provider.enable_scheduled_backlog else '' %>/>
|
||||
<p>$scheduled_backlog_tip</p>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
</span>
|
||||
</div>
|
||||
#end if
|
||||
#if $cur_newznab_provider.default and $cur_newznab_provider.needs_auth
|
||||
<div class="field-pair">
|
||||
<label for="${cur_newznab_provider.get_id()}_url">
|
||||
|
@ -218,28 +251,6 @@
|
|||
</label>
|
||||
</div>
|
||||
#end if
|
||||
#if $hasattr($cur_newznab_provider, 'enable_recentsearch') and $cur_newznab_provider.supports_backlog:
|
||||
<div class="field-pair">
|
||||
<label for="${cur_newznab_provider.get_id()}_enable_recentsearch">
|
||||
<span class="component-title">Enable recent searches</span>
|
||||
<span class="component-desc">
|
||||
<input type="checkbox" name="${cur_newznab_provider.get_id()}_enable_recentsearch" id="${cur_newznab_provider.get_id()}_enable_recentsearch" <%= html_checked if cur_newznab_provider.enable_recentsearch else '' %>/>
|
||||
<p>perform recent searches at provider</p>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
#if $hasattr($cur_newznab_provider, 'enable_backlog') and $cur_newznab_provider.supports_backlog:
|
||||
<div class="field-pair">
|
||||
<label for="${cur_newznab_provider.get_id()}_enable_backlog">
|
||||
<span class="component-title">Enable backlog searches</span>
|
||||
<span class="component-desc">
|
||||
<input type="checkbox" name="${cur_newznab_provider.get_id()}_enable_backlog" id="${cur_newznab_provider.get_id()}_enable_backlog" <%= html_checked if cur_newznab_provider.enable_backlog else '' %>/>
|
||||
<p>perform backlog searches at provider</p>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
#if $hasattr($cur_newznab_provider, 'search_mode') and $cur_newznab_provider.supports_backlog:
|
||||
<div class="field-pair">
|
||||
<span class="component-title">Episode search mode</span>
|
||||
|
@ -273,6 +284,36 @@
|
|||
#for $cur_nzb_provider in [$cur_provider for $cur_provider in $sickbeard.providers.sortedProviderList()
|
||||
if $cur_provider.providerType == $GenericProvider.NZB and $cur_provider not in $sickbeard.newznabProviderList]:
|
||||
<div class="providerDiv" id="${cur_nzb_provider.get_id()}Div">
|
||||
#set $can_recent = $hasattr($cur_nzb_provider, 'enable_recentsearch')
|
||||
#set $can_backlog = $hasattr($cur_nzb_provider, 'enable_backlog')
|
||||
#set $can_schedule_backlog = $hasattr($cur_nzb_provider, 'enable_scheduled_backlog')
|
||||
#if $cur_nzb_provider.supports_backlog and ($can_recent or $can_backlog or $can_schedule_backlog)
|
||||
<div class="field-pair">
|
||||
<span class="component-title">Perform search tasks</span>
|
||||
<span class="component-desc">
|
||||
#if $can_recent
|
||||
<label for="${cur_nzb_provider.get_id()}_enable_recentsearch" style="display:inline">
|
||||
<input type="checkbox" name="${cur_nzb_provider.get_id()}_enable_recentsearch" id="${cur_nzb_provider.get_id()}_enable_recentsearch" <%= html_checked if cur_nzb_provider.enable_recentsearch else '' %>/>
|
||||
<p>$recentsearch_tip</p>
|
||||
</label>
|
||||
#end if
|
||||
#if $can_backlog
|
||||
<label for="${cur_nzb_provider.get_id()}_enable_backlog" style="display:inline">
|
||||
<input class="enabler" type="checkbox" name="${cur_nzb_provider.get_id()}_enable_backlog" id="${cur_nzb_provider.get_id()}_enable_backlog" <%= html_checked if cur_nzb_provider.enable_backlog else '' %>/>
|
||||
<p>$backlogsearch_tip</p>
|
||||
</label>
|
||||
#end if
|
||||
#if $can_schedule_backlog
|
||||
<div id="content_${cur_nzb_provider.get_id()}_enable_backlog">
|
||||
<label for="${cur_nzb_provider.get_id()}_enable_scheduled_backlog" style="display:inline">
|
||||
<input type="checkbox" name="${cur_nzb_provider.get_id()}_enable_scheduled_backlog" id="${cur_nzb_provider.get_id()}_enable_scheduled_backlog" <%= html_checked if cur_nzb_provider.enable_scheduled_backlog else '' %>/>
|
||||
<p>$scheduled_backlog_tip</p>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
</span>
|
||||
</div>
|
||||
#end if
|
||||
#if $hasattr($cur_nzb_provider, 'username'):
|
||||
<div class="field-pair">
|
||||
<label for="${cur_nzb_provider.get_id()}_username">
|
||||
|
@ -297,28 +338,6 @@
|
|||
</label>
|
||||
</div>
|
||||
#end if
|
||||
#if $hasattr($cur_nzb_provider, 'enable_recentsearch') and $cur_nzb_provider.supports_backlog:
|
||||
<div class="field-pair">
|
||||
<label for="${cur_nzb_provider.get_id()}_enable_recentsearch">
|
||||
<span class="component-title">Enable recent searches</span>
|
||||
<span class="component-desc">
|
||||
<input type="checkbox" name="${cur_nzb_provider.get_id()}_enable_recentsearch" id="${cur_nzb_provider.get_id()}_enable_recentsearch" <%= html_checked if cur_nzb_provider.enable_recentsearch else '' %>/>
|
||||
<p>enable provider to perform recent searches</p>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
#if $hasattr($cur_nzb_provider, 'enable_backlog') and $cur_nzb_provider.supports_backlog:
|
||||
<div class="field-pair">
|
||||
<label for="${cur_nzb_provider.get_id()}_enable_backlog">
|
||||
<span class="component-title">Enable backlog searches</span>
|
||||
<span class="component-desc">
|
||||
<input type="checkbox" name="${cur_nzb_provider.get_id()}_enable_backlog" id="${cur_nzb_provider.get_id()}_enable_backlog" <%= html_checked if cur_nzb_provider.enable_backlog else '' %>/>
|
||||
<p>enable provider to perform backlog searches</p>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
#if $hasattr($cur_nzb_provider, 'search_mode') and $cur_nzb_provider.supports_backlog:
|
||||
<div class="field-pair">
|
||||
<span class="component-title">Episode search mode</span>
|
||||
|
@ -368,6 +387,36 @@
|
|||
</div>
|
||||
#end if
|
||||
#end if
|
||||
#set $can_recent = $hasattr($cur_torrent_provider, 'enable_recentsearch')
|
||||
#set $can_backlog = $hasattr($cur_torrent_provider, 'enable_backlog')
|
||||
#set $can_schedule_backlog = $hasattr($cur_torrent_provider, 'enable_scheduled_backlog')
|
||||
#if $cur_torrent_provider.supports_backlog and ($can_recent or $can_backlog or $can_schedule_backlog)
|
||||
<div class="field-pair">
|
||||
<span class="component-title">Perform search tasks</span>
|
||||
<span class="component-desc">
|
||||
#if $can_recent
|
||||
<label for="${cur_torrent_provider.get_id()}_enable_recentsearch" style="display:inline">
|
||||
<input type="checkbox" name="${cur_torrent_provider.get_id()}_enable_recentsearch" id="${cur_torrent_provider.get_id()}_enable_recentsearch" <%= html_checked if cur_torrent_provider.enable_recentsearch else '' %>/>
|
||||
<p>$recentsearch_tip</p>
|
||||
</label>
|
||||
#end if
|
||||
#if $can_backlog
|
||||
<label for="${cur_torrent_provider.get_id()}_enable_backlog" style="display:inline">
|
||||
<input class="enabler" type="checkbox" name="${cur_torrent_provider.get_id()}_enable_backlog" id="${cur_torrent_provider.get_id()}_enable_backlog" <%= html_checked if cur_torrent_provider.enable_backlog else '' %>/>
|
||||
<p>$backlogsearch_tip</p>
|
||||
</label>
|
||||
#end if
|
||||
#if $can_schedule_backlog
|
||||
<div id="content_${cur_torrent_provider.get_id()}_enable_backlog">
|
||||
<label for="${cur_torrent_provider.get_id()}_enable_scheduled_backlog" style="display:inline">
|
||||
<input type="checkbox" name="${cur_torrent_provider.get_id()}_enable_scheduled_backlog" id="${cur_torrent_provider.get_id()}_enable_scheduled_backlog" <%= html_checked if cur_torrent_provider.enable_scheduled_backlog else '' %>/>
|
||||
<p>$scheduled_backlog_tip</p>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
</span>
|
||||
</div>
|
||||
#end if
|
||||
#if $getattr($cur_torrent_provider, 'url_edit', None):
|
||||
<div class="field-pair">
|
||||
<label for="url_base">
|
||||
|
@ -553,28 +602,6 @@ name = '' if not client else get_client_instance(sickbeard.TORRENT_METHOD)().nam
|
|||
</label>
|
||||
</div>
|
||||
#end if
|
||||
#if $hasattr($cur_torrent_provider, 'enable_recentsearch') and $cur_torrent_provider.supports_backlog:
|
||||
<div class="field-pair">
|
||||
<label for="${cur_torrent_provider.get_id()}_enable_recentsearch">
|
||||
<span class="component-title">Enable recent searches</span>
|
||||
<span class="component-desc">
|
||||
<input type="checkbox" name="${cur_torrent_provider.get_id()}_enable_recentsearch" id="${cur_torrent_provider.get_id()}_enable_recentsearch" <%= html_checked if cur_torrent_provider.enable_recentsearch else '' %>/>
|
||||
<p>enable provider to perform recent searches</p>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
#if $hasattr($cur_torrent_provider, 'enable_backlog') and $cur_torrent_provider.supports_backlog:
|
||||
<div class="field-pair">
|
||||
<label for="${cur_torrent_provider.get_id()}_enable_backlog">
|
||||
<span class="component-title">Enable backlog searches</span>
|
||||
<span class="component-desc">
|
||||
<input type="checkbox" name="${cur_torrent_provider.get_id()}_enable_backlog" id="${cur_torrent_provider.get_id()}_enable_backlog" <%= html_checked if cur_torrent_provider.enable_backlog else '' %>/>
|
||||
<p>enable provider to perform backlog searches</p>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
#if $hasattr($cur_torrent_provider, 'search_mode') and $cur_torrent_provider.supports_backlog:
|
||||
<div class="field-pair">
|
||||
<span class="component-title">Episode search mode</span>
|
||||
|
@ -622,8 +649,8 @@ name = '' if not client else get_client_instance(sickbeard.TORRENT_METHOD)().nam
|
|||
<div id="core-component-group3" class="component-group">
|
||||
|
||||
<div class="component-group-desc">
|
||||
<h3>Custom Newznab Providers</h3>
|
||||
<p>Add, setup or remove custom newznab providers.</p>
|
||||
<h3>Custom Newznab</h3>
|
||||
<p>Add, setup or remove newznab providers.</p>
|
||||
</div>
|
||||
|
||||
<fieldset class="component-group-list">
|
||||
|
@ -719,8 +746,8 @@ name = '' if not client else get_client_instance(sickbeard.TORRENT_METHOD)().nam
|
|||
<div id="core-component-group4" class="component-group">
|
||||
|
||||
<div class="component-group-desc">
|
||||
<h3>Custom Torrent Providers</h3>
|
||||
<p>Add or remove custom RSS providers.</p>
|
||||
<h3>Custom Torrent</h3>
|
||||
<p>Add, setup or remove torrent RSS providers.</p>
|
||||
</div>
|
||||
|
||||
<fieldset class="component-group-list">
|
||||
|
|
|
@ -1145,6 +1145,8 @@ def initialize(console_logging=True):
|
|||
not getattr(torrent_prov, 'supports_backlog')
|
||||
if hasattr(torrent_prov, 'enable_backlog'):
|
||||
torrent_prov.enable_backlog = bool(check_setting_int(CFG, prov_id_uc, prov_id + '_enable_backlog', 1))
|
||||
if hasattr(torrent_prov, 'enable_scheduled_backlog'):
|
||||
torrent_prov.enable_scheduled_backlog = bool(check_setting_int(CFG, prov_id_uc, prov_id + '_enable_scheduled_backlog', 1))
|
||||
if hasattr(torrent_prov, 'search_mode'):
|
||||
torrent_prov.search_mode = check_setting_str(CFG, prov_id_uc, prov_id + '_search_mode', 'eponly')
|
||||
if hasattr(torrent_prov, 'search_fallback'):
|
||||
|
@ -1172,6 +1174,8 @@ def initialize(console_logging=True):
|
|||
not getattr(nzb_prov, 'supports_backlog')
|
||||
if hasattr(nzb_prov, 'enable_backlog'):
|
||||
nzb_prov.enable_backlog = bool(check_setting_int(CFG, prov_id_uc, prov_id + '_enable_backlog', 1))
|
||||
if hasattr(nzb_prov, 'enable_scheduled_backlog'):
|
||||
nzb_prov.enable_scheduled_backlog = bool(check_setting_int(CFG, prov_id_uc, prov_id + '_enable_scheduled_backlog', 1))
|
||||
|
||||
if not os.path.isfile(CONFIG_FILE):
|
||||
logger.log(u'Unable to find \'%s\', all settings will be default!' % CONFIG_FILE, logger.DEBUG)
|
||||
|
@ -1562,7 +1566,7 @@ def save_config():
|
|||
('api_key', None), ('passkey', None), ('digest', None), ('hash', None), ('username', ''), ('uid', ''),
|
||||
('minseed', 1), ('minleech', 1), ('confirmed', 1), ('freeleech', 1), ('reject_m2ts', 1),
|
||||
('enable_recentsearch', 1), ('enable_backlog', 1), ('search_mode', None), ('search_fallback', 1),
|
||||
('seed_time', None)] if hasattr(src, k)]:
|
||||
('seed_time', None), ('enable_scheduled_backlog', 1)] if hasattr(src, k)]:
|
||||
new_config[src_id_uc][setting] = value
|
||||
|
||||
if hasattr(src, '_seed_ratio'):
|
||||
|
@ -1579,7 +1583,8 @@ def save_config():
|
|||
for attr in [x for x in ['api_key', 'username', 'search_mode'] if hasattr(src, x)]:
|
||||
new_config[src_id_uc]['%s_%s' % (src_id, attr)] = getattr(src, attr)
|
||||
|
||||
for attr in [x for x in ['enable_recentsearch', 'enable_backlog', 'search_fallback'] if hasattr(src, x)]:
|
||||
for attr in [x for x in ['enable_recentsearch', 'enable_backlog', 'search_fallback',
|
||||
'enable_scheduled_backlog'] if hasattr(src, x)]:
|
||||
new_config[src_id_uc]['%s_%s' % (src_id, attr)] = helpers.tryInt(getattr(src, attr, None))
|
||||
|
||||
new_config['SABnzbd'] = {}
|
||||
|
|
|
@ -144,6 +144,7 @@ def getNewznabProviderList(data):
|
|||
providerDict[curDefault.name].search_fallback = curDefault.search_fallback
|
||||
providerDict[curDefault.name].enable_recentsearch = curDefault.enable_recentsearch
|
||||
providerDict[curDefault.name].enable_backlog = curDefault.enable_backlog
|
||||
providerDict[curDefault.name].enable_scheduled_backlog = curDefault.enable_scheduled_backlog
|
||||
|
||||
return filter(lambda x: x, providerList)
|
||||
|
||||
|
@ -156,10 +157,14 @@ def makeNewznabProvider(configString):
|
|||
search_fallback = 0
|
||||
enable_recentsearch = 0
|
||||
enable_backlog = 0
|
||||
enable_scheduled_backlog = 1
|
||||
|
||||
try:
|
||||
values = configString.split('|')
|
||||
if len(values) == 9:
|
||||
if len(values) == 10:
|
||||
name, url, key, cat_ids, enabled, search_mode, search_fallback, enable_recentsearch, enable_backlog, \
|
||||
enable_scheduled_backlog = values
|
||||
elif len(values) == 9:
|
||||
name, url, key, cat_ids, enabled, search_mode, search_fallback, enable_recentsearch, enable_backlog = values
|
||||
else:
|
||||
name = values[0]
|
||||
|
@ -175,7 +180,7 @@ def makeNewznabProvider(configString):
|
|||
|
||||
newProvider = newznab.NewznabProvider(name, url, key=key, cat_ids=cat_ids, search_mode=search_mode,
|
||||
search_fallback=search_fallback, enable_recentsearch=enable_recentsearch,
|
||||
enable_backlog=enable_backlog)
|
||||
enable_backlog=enable_backlog, enable_scheduled_backlog=enable_scheduled_backlog)
|
||||
newProvider.enabled = enabled == '1'
|
||||
|
||||
return newProvider
|
||||
|
@ -204,10 +209,14 @@ def makeTorrentRssProvider(configString):
|
|||
search_fallback = 0
|
||||
enable_recentsearch = 0
|
||||
enable_backlog = 0
|
||||
enable_scheduled_backlog = 1
|
||||
|
||||
try:
|
||||
values = configString.split('|')
|
||||
if len(values) == 8:
|
||||
if len(values) == 9:
|
||||
name, url, cookies, enabled, search_mode, search_fallback, enable_recentsearch, enable_backlog, \
|
||||
enable_scheduled_backlog = values
|
||||
elif len(values) == 8:
|
||||
name, url, cookies, enabled, search_mode, search_fallback, enable_recentsearch, enable_backlog = values
|
||||
else:
|
||||
name = values[0]
|
||||
|
@ -224,7 +233,7 @@ def makeTorrentRssProvider(configString):
|
|||
return
|
||||
|
||||
newProvider = torrentRss.TorrentRssProvider(name, url, cookies, search_mode, search_fallback, enable_recentsearch,
|
||||
enable_backlog)
|
||||
enable_backlog, enable_scheduled_backlog)
|
||||
newProvider.enabled = enabled == '1'
|
||||
|
||||
return newProvider
|
||||
|
|
|
@ -70,6 +70,7 @@ class GenericProvider:
|
|||
self.enabled = False
|
||||
self.enable_recentsearch = False
|
||||
self.enable_backlog = False
|
||||
self.enable_scheduled_backlog = True
|
||||
self.categories = None
|
||||
|
||||
self.cache = tvcache.TVCache(self)
|
||||
|
@ -718,7 +719,7 @@ class NZBProvider(object, GenericProvider):
|
|||
if has_key:
|
||||
return has_key
|
||||
if None is has_key:
|
||||
raise AuthException('%s for %s is empty in config provider options'
|
||||
raise AuthException('%s for %s is empty in Media Providers/Options'
|
||||
% ('API key' + ('', ' and/or Username')[hasattr(self, 'username')], self.name))
|
||||
|
||||
return GenericProvider._check_auth(self)
|
||||
|
@ -1117,7 +1118,7 @@ class TorrentProvider(object, GenericProvider):
|
|||
else:
|
||||
return not is_required and GenericProvider._check_auth(self)
|
||||
|
||||
raise AuthException('%s for %s is empty in config provider options' % (setting, self.name))
|
||||
raise AuthException('%s for %s is empty in Media Providers/Options' % (setting, self.name))
|
||||
|
||||
def find_propers(self, **kwargs):
|
||||
"""
|
||||
|
|
|
@ -34,6 +34,7 @@ from sickbeard.indexers.indexer_config import *
|
|||
from io import BytesIO
|
||||
from lib.dateutil import parser
|
||||
from sickbeard.network_timezones import sb_timezone
|
||||
from sickbeard.helpers import tryInt
|
||||
|
||||
try:
|
||||
from lxml import etree
|
||||
|
@ -90,7 +91,7 @@ class NewznabConstants:
|
|||
class NewznabProvider(generic.NZBProvider):
|
||||
|
||||
def __init__(self, name, url, key='', cat_ids=None, search_mode=None,
|
||||
search_fallback=False, enable_recentsearch=False, enable_backlog=False):
|
||||
search_fallback=False, enable_recentsearch=False, enable_backlog=False, enable_scheduled_backlog=False):
|
||||
generic.NZBProvider.__init__(self, name, True, False)
|
||||
|
||||
self.url = url
|
||||
|
@ -100,7 +101,8 @@ class NewznabProvider(generic.NZBProvider):
|
|||
self.search_mode = search_mode or 'eponly'
|
||||
self.search_fallback = search_fallback
|
||||
self.enable_recentsearch = enable_recentsearch
|
||||
self.enable_backlog = enable_backlog
|
||||
self.enable_backlog = bool(tryInt(enable_backlog))
|
||||
self.enable_scheduled_backlog = bool(tryInt(enable_scheduled_backlog))
|
||||
self.needs_auth = '0' != self.key.strip() # '0' in the key setting indicates that api_key is not needed
|
||||
self.default = False
|
||||
self._caps = {}
|
||||
|
@ -295,9 +297,10 @@ class NewznabProvider(generic.NZBProvider):
|
|||
return True
|
||||
|
||||
def config_str(self):
|
||||
return '%s|%s|%s|%s|%i|%s|%i|%i|%i' \
|
||||
return '%s|%s|%s|%s|%i|%s|%i|%i|%i|%i' \
|
||||
% (self.name or '', self.url or '', self.maybe_apikey() or '', self.cat_ids or '', self.enabled,
|
||||
self.search_mode or '', self.search_fallback, self.enable_recentsearch, self.enable_backlog)
|
||||
self.search_mode or '', self.search_fallback, self.enable_recentsearch, self.enable_backlog,
|
||||
self.enable_scheduled_backlog)
|
||||
|
||||
def _season_strings(self, ep_obj):
|
||||
|
||||
|
|
|
@ -28,8 +28,9 @@ from lib.bencode import bdecode
|
|||
class TorrentRssProvider(generic.TorrentProvider):
|
||||
|
||||
def __init__(self, name, url, cookies='', search_mode='eponly', search_fallback=False,
|
||||
enable_recentsearch=False, enable_backlog=False):
|
||||
enable_recentsearch=False, enable_backlog=False, enable_scheduled_backlog=False):
|
||||
self.enable_backlog = bool(tryInt(enable_backlog))
|
||||
self.enable_scheduled_backlog = bool(tryInt(enable_scheduled_backlog))
|
||||
generic.TorrentProvider.__init__(self, name, supports_backlog=self.enable_backlog, cache_update_freq=15)
|
||||
|
||||
self.url = url.rstrip('/')
|
||||
|
@ -48,9 +49,10 @@ class TorrentRssProvider(generic.TorrentProvider):
|
|||
|
||||
def config_str(self):
|
||||
|
||||
return '%s|%s|%s|%d|%s|%d|%d|%d' % (
|
||||
return '%s|%s|%s|%d|%s|%d|%d|%d|%d' % (
|
||||
self.name or '', self.url or '', self.cookies or '', self.enabled,
|
||||
self.search_mode or '', self.search_fallback, self.enable_recentsearch, self.enable_backlog)
|
||||
self.search_mode or '', self.search_fallback, self.enable_recentsearch, self.enable_backlog,
|
||||
self.enable_scheduled_backlog)
|
||||
|
||||
def _title_and_url(self, item):
|
||||
|
||||
|
|
|
@ -457,7 +457,7 @@ def search_for_needed_episodes(episodes):
|
|||
threading.currentThread().name = orig_thread_name
|
||||
|
||||
if not len(providers):
|
||||
logger.log('No NZB/Torrent sources enabled in Search Provider options to do recent searches', logger.WARNING)
|
||||
logger.log('No NZB/Torrent providers in Media Providers/Options are enabled to match recent episodes', logger.WARNING)
|
||||
elif not search_done:
|
||||
logger.log('Failed recent search of %s enabled provider%s. More info in debug log.' % (
|
||||
len(providers), helpers.maybe_plural(len(providers))), logger.ERROR)
|
||||
|
@ -465,7 +465,7 @@ def search_for_needed_episodes(episodes):
|
|||
return found_results.values()
|
||||
|
||||
|
||||
def search_providers(show, episodes, manual_search=False, torrent_only=False, try_other_searches=False):
|
||||
def search_providers(show, episodes, manual_search=False, torrent_only=False, try_other_searches=False, scheduled=False):
|
||||
found_results = {}
|
||||
final_results = []
|
||||
|
||||
|
@ -474,7 +474,8 @@ def search_providers(show, episodes, manual_search=False, torrent_only=False, tr
|
|||
orig_thread_name = threading.currentThread().name
|
||||
|
||||
provider_list = [x for x in sickbeard.providers.sortedProviderList() if x.is_active() and x.enable_backlog and
|
||||
(not torrent_only or x.providerType == GenericProvider.TORRENT)]
|
||||
(not torrent_only or x.providerType == GenericProvider.TORRENT) and
|
||||
(not scheduled or x.enable_scheduled_backlog)]
|
||||
for cur_provider in provider_list:
|
||||
if cur_provider.anime_only and not show.is_anime:
|
||||
logger.log(u'%s is not an anime, skipping' % show.name, logger.DEBUG)
|
||||
|
@ -773,9 +774,9 @@ def search_providers(show, episodes, manual_search=False, torrent_only=False, tr
|
|||
break
|
||||
|
||||
if not len(provider_list):
|
||||
logger.log('No NZB/Torrent sources enabled in Search Provider options to do backlog searches', logger.WARNING)
|
||||
logger.log('No NZB/Torrent providers in Media Providers/Options are allowed for active searching', logger.WARNING)
|
||||
elif not search_done:
|
||||
logger.log('Failed backlog search of %s enabled provider%s. More info in debug log.' % (
|
||||
logger.log('Failed active search of %s enabled provider%s. More info in debug log.' % (
|
||||
len(provider_list), helpers.maybe_plural(len(provider_list))), logger.ERROR)
|
||||
|
||||
return final_results
|
||||
|
|
|
@ -339,7 +339,7 @@ class RecentSearchQueueItem(generic_queue.QueueItem):
|
|||
threads[-1].start()
|
||||
|
||||
if not len(providers):
|
||||
logger.log('No NZB/Torrent sources enabled in Search Provider options for cache update', logger.WARNING)
|
||||
logger.log('No NZB/Torrent providers in Media Providers/Options are enabled to match recent episodes', logger.WARNING)
|
||||
|
||||
if threads:
|
||||
# wait for all threads to finish
|
||||
|
@ -429,7 +429,8 @@ class BacklogQueueItem(generic_queue.QueueItem):
|
|||
logger.log(u'Beginning backlog search for: [%s]' % self.show.name)
|
||||
search_result = search.search_providers(
|
||||
self.show, self.segment, False,
|
||||
try_other_searches=(not self.standard_backlog or not self.limited_backlog))
|
||||
try_other_searches=(not self.standard_backlog or not self.limited_backlog),
|
||||
scheduled=self.standard_backlog)
|
||||
|
||||
if search_result:
|
||||
for result in search_result:
|
||||
|
|
|
@ -5247,7 +5247,7 @@ class ConfigProviders(Config):
|
|||
if cur_id + '_' + attr in kwargs:
|
||||
setattr(nzb_src, attr, str(kwargs.get(cur_id + '_' + attr)).strip())
|
||||
|
||||
for attr in ['search_fallback', 'enable_recentsearch', 'enable_backlog']:
|
||||
for attr in ['search_fallback', 'enable_recentsearch', 'enable_backlog', 'enable_scheduled_backlog']:
|
||||
setattr(nzb_src, attr, config.checkbox_to_value(kwargs.get(cur_id + '_' + attr)))
|
||||
|
||||
else:
|
||||
|
@ -5350,7 +5350,7 @@ class ConfigProviders(Config):
|
|||
setattr(torrent_src, attr, config.to_int(str(kwargs.get(src_id_prefix + attr)).strip()))
|
||||
|
||||
for attr in [x for x in ['confirmed', 'freeleech', 'reject_m2ts', 'enable_recentsearch',
|
||||
'enable_backlog', 'search_fallback']
|
||||
'enable_backlog', 'search_fallback', 'enable_scheduled_backlog']
|
||||
if hasattr(torrent_src, x) and src_id_prefix + attr in kwargs]:
|
||||
setattr(torrent_src, attr, config.checkbox_to_value(kwargs.get(src_id_prefix + attr)))
|
||||
|
||||
|
@ -5392,7 +5392,7 @@ class ConfigProviders(Config):
|
|||
setattr(nzb_src, attr, config.checkbox_to_value(kwargs.get(src_id_prefix + attr)) or
|
||||
not getattr(nzb_src, 'supports_backlog', True))
|
||||
|
||||
for attr in [x for x in ['search_fallback', 'enable_backlog'] if hasattr(nzb_src, x)]:
|
||||
for attr in [x for x in ['search_fallback', 'enable_backlog', 'enable_scheduled_backlog'] if hasattr(nzb_src, x)]:
|
||||
setattr(nzb_src, attr, config.checkbox_to_value(kwargs.get(src_id_prefix + attr)))
|
||||
|
||||
sickbeard.NEWZNAB_DATA = '!!!'.join([x.config_str() for x in sickbeard.newznabProviderList])
|
||||
|
|
Loading…
Reference in a new issue