Change Config/Media Providers/Custom Newznab "Extra categories..." for disabled nzb providers.

This commit is contained in:
JackDandy 2016-12-20 16:30:59 +00:00
parent 2b27e3bb74
commit f356099293
4 changed files with 517 additions and 549 deletions

View file

@ -677,7 +677,7 @@ name = '' if not client else get_client_instance(sickbeard.TORRENT_METHOD)().nam
<span style="font-weight:normal">with.. (u)hd, sd, sport, anime</span>
</span>
<span class="component-desc">
<div id="nn-cats">
<div id="nn-cats" class="hide">
<div class="pull-left">
<select class="pull-left" id="newznab_cap" multiple="multiple" style="min-width:10em;min-height:72px"></select>
<input class="btn" type="button" class="newznab_cat_update" id="newznab_cat_update" value=">>" style="position:relative;bottom:-15px">
@ -691,8 +691,11 @@ name = '' if not client else get_client_instance(sickbeard.TORRENT_METHOD)().nam
<div id="nn-nocats" class="hide">
<span>No extra categories found</span>
</div>
<div id="nn-enable-for-cats" class="hide">
<span class="grey-text">Enable provider for categories</span>
</div>
<div id="nn-loadcats" class="hide">
<span>Loading categories...</span>
<span class="grey-text">Loading categories...</span>
</div>
</span>
</label>

View file

@ -74,7 +74,7 @@
<!--
var sbRoot = '$sbRoot', anonURL = '$sg_str('ANON_REDIRECT')', themeSpinner = '#echo ('', '-dark')['dark' == $sg_str('THEME_NAME', 'dark')]#',
top_image_html = '<img src="$sbRoot/images/top.gif" width="31" height="11" alt="Jump to top" />', topmenu = '$topmenu';
\$.SickGear = {Root: '${sbRoot}', PID: '${sbPID}'};
\$.SickGear = {Root: '${sbRoot}', PID: '${sbPID}', anonURL: '$sg_str('ANON_REDIRECT')'};
//-->
</script>
<script type="text/javascript" src="$sbRoot/js/lib/jquery.scrolltopcontrol-1.1.js"></script>

File diff suppressed because it is too large Load diff

View file

@ -5121,7 +5121,9 @@ class ConfigProviders(Config):
return json.dumps({'success': False, 'error': error})
if name in [n.name for n in sickbeard.newznabProviderList if n.url == url]:
tv_categories = newznab.NewznabProvider.clean_newznab_categories([n for n in sickbeard.newznabProviderList if n.name == name][0].all_cats)
provider = [n for n in sickbeard.newznabProviderList if n.name == name][0]
tv_categories = newznab.NewznabProvider.clean_newznab_categories(provider.all_cats)
state = provider.is_enabled()
else:
providers = dict(zip([x.get_id() for x in sickbeard.newznabProviderList], sickbeard.newznabProviderList))
temp_provider = newznab.NewznabProvider(name, url, key)
@ -5129,8 +5131,9 @@ class ConfigProviders(Config):
temp_provider.key = providers[temp_provider.get_id()].key
tv_categories = newznab.NewznabProvider.clean_newznab_categories(temp_provider.all_cats)
state = False
return json.dumps({'success': True, 'tv_categories': tv_categories, 'error': ''})
return json.dumps({'success': True, 'tv_categories': tv_categories, 'state': state, 'error': ''})
def deleteNewznabProvider(self, nnid):