Merge branch 'origin/dev'

This commit is contained in:
echel0n 2014-05-23 09:39:22 -07:00
commit eebbcb1253
4 changed files with 13 additions and 41 deletions

View file

@ -225,7 +225,7 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#;
</div> </div>
#end if #end if
#if $hasattr($curNewznabProvider, 'backlog_only'): #if $hasattr($curNzbProvider, 'backlog_only'):
<div class="field-pair"> <div class="field-pair">
<input type="checkbox" name="${curNzbProvider.getID()}_backlog_only" id="${curNzbProvider.getID()}_backlog_only" #if $curNzbProvider.backlog_only then "checked=\"checked\"" else ""#/> <input type="checkbox" name="${curNzbProvider.getID()}_backlog_only" id="${curNzbProvider.getID()}_backlog_only" #if $curNzbProvider.backlog_only then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="${curNzbProvider.getID()}_backlog_only"> <label class="clearfix" for="${curNzbProvider.getID()}_backlog_only">

View file

@ -867,8 +867,8 @@ def initialize(consoleLogging=True):
NEWZNAB_DATA = check_setting_str(CFG, 'Newznab', 'newznab_data', '') NEWZNAB_DATA = check_setting_str(CFG, 'Newznab', 'newznab_data', '')
newznabProviderList = providers.getNewznabProviderList(NEWZNAB_DATA) newznabProviderList = providers.getNewznabProviderList(NEWZNAB_DATA)
torrentRssData = check_setting_str(CFG, 'TorrentRss', 'torrentrss_data', '') TORRENTRSS_DATA = check_setting_str(CFG, 'TorrentRss', 'torrentrss_data', '')
torrentRssProviderList = providers.getTorrentRssProviderList(torrentRssData) torrentRssProviderList = providers.getTorrentRssProviderList(TORRENTRSS_DATA)
if not os.path.isfile(CONFIG_FILE): if not os.path.isfile(CONFIG_FILE):
logger.log(u"Unable to find '" + CONFIG_FILE + "', all settings will be default!", logger.DEBUG) logger.log(u"Unable to find '" + CONFIG_FILE + "', all settings will be default!", logger.DEBUG)

View file

@ -58,7 +58,6 @@ def sortedProviderList():
return newList return newList
def makeProviderList(): def makeProviderList():
return [x.provider for x in [getProviderModule(y) for y in __all__] if x] return [x.provider for x in [getProviderModule(y) for y in __all__] if x]

View file

@ -1476,7 +1476,9 @@ class ConfigProviders:
cur_name, cur_url, cur_key = curNewznabProviderStr.split('|') cur_name, cur_url, cur_key = curNewznabProviderStr.split('|')
cur_url = config.clean_url(cur_url) cur_url = config.clean_url(cur_url)
newProvider = newznab.NewznabProvider(cur_name, cur_url, key=cur_key) newProvider = newznab.NewznabProvider(cur_name, cur_url, key=cur_key)
cur_id = newProvider.getID() cur_id = newProvider.getID()
# if it already exists then update it # if it already exists then update it
@ -1489,38 +1491,11 @@ class ConfigProviders:
newznabProviderDict[cur_id].needs_auth = False newznabProviderDict[cur_id].needs_auth = False
else: else:
newznabProviderDict[cur_id].needs_auth = True newznabProviderDict[cur_id].needs_auth = True
try:
newznabProviderDict[cur_id].search_mode = str(kwargs[cur_id + '_search_mode']).strip()
except:
newznabProviderDict[cur_id].search_mode = 'eponly'
try:
newznabProviderDict[cur_id].search_fallback = config.checkbox_to_value(
kwargs[cur_id + '_search_fallback'])
except:
newznabProviderDict[cur_id].search_fallback = 0
else: else:
try:
newProvider.search_mode = str(kwargs[cur_id + '_search_mode']).strip()
except:
newProvider.search_mode = 'eponly'
try:
newProvider.search_fallback = config.checkbox_to_value(
kwargs[cur_id + '_search_fallback'])
except:
newProvider.search_fallback = 0
sickbeard.newznabProviderList.append(newProvider) sickbeard.newznabProviderList.append(newProvider)
finishedNames.append(cur_id) finishedNames.append(cur_id)
# delete anything that is missing
for curProvider in sickbeard.newznabProviderList:
if curProvider.getID() not in finishedNames:
sickbeard.newznabProviderList.remove(curProvider)
# delete anything that is missing # delete anything that is missing
for curProvider in sickbeard.newznabProviderList: for curProvider in sickbeard.newznabProviderList:
if curProvider.getID() not in finishedNames: if curProvider.getID() not in finishedNames:
@ -1553,7 +1528,6 @@ class ConfigProviders:
finishedNames.append(curID) finishedNames.append(curID)
# delete anything that is missing # delete anything that is missing
#logger.log(u"sickbeard.anyRssProviderList = " + repr(sickbeard.anyRssProviderList))
for curProvider in sickbeard.torrentRssProviderList: for curProvider in sickbeard.torrentRssProviderList:
if curProvider.getID() not in finishedNames: if curProvider.getID() not in finishedNames:
sickbeard.torrentRssProviderList.remove(curProvider) sickbeard.torrentRssProviderList.remove(curProvider)
@ -1563,16 +1537,15 @@ class ConfigProviders:
curProvider, curEnabled = curProviderStr.split(':') curProvider, curEnabled = curProviderStr.split(':')
curEnabled = config.to_int(curEnabled) curEnabled = config.to_int(curEnabled)
curProvObj = [x for x in sickbeard.providers.sortedProviderList() if x.getID() == curProvider and hasattr(x, 'enabled')]
if curProvObj:
curProvObj[0].enabled = bool(curEnabled)
provider_list.append(curProvider) provider_list.append(curProvider)
if curProvider in newznabProviderDict:
# dynamically set providers enabled/disabled newznabProviderDict[curProvider].enabled = bool(curEnabled)
providers = sickbeard.providers.sortedProviderList() elif curProvider in torrentRssProviderDict:
for provider in providers: torrentRssProviderDict[curProvider].enabled = bool(curEnabled)
if provider.getID() != curProvider or not hasattr(provider, 'enabled'):
continue
provider.enabled = curEnabled
break
# dynamically load provider settings # dynamically load provider settings
for curTorrentProvider in [curProvider for curProvider in sickbeard.providers.sortedProviderList() if for curTorrentProvider in [curProvider for curProvider in sickbeard.providers.sortedProviderList() if