From faaf351662a3d5896b9fced3967c9804623c20f2 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 20 Jan 2013 20:50:50 +0100 Subject: [PATCH] Group providers together --- couchpotato/core/downloaders/__init__.py | 13 ++++ couchpotato/core/downloaders/blackhole/__init__.py | 1 + couchpotato/core/downloaders/nzbget/__init__.py | 1 + couchpotato/core/downloaders/nzbvortex/__init__.py | 1 + couchpotato/core/downloaders/pneumatic/__init__.py | 1 + couchpotato/core/downloaders/sabnzbd/__init__.py | 1 + couchpotato/core/downloaders/synology/__init__.py | 1 + .../core/downloaders/transmission/__init__.py | 1 + couchpotato/core/downloaders/utorrent/__init__.py | 1 + couchpotato/core/loader.py | 12 ++++ couchpotato/core/notifications/__init__.py | 13 ++++ couchpotato/core/notifications/boxcar/__init__.py | 1 + couchpotato/core/notifications/email/__init__.py | 1 + couchpotato/core/notifications/growl/__init__.py | 1 + couchpotato/core/notifications/nmj/__init__.py | 1 + couchpotato/core/notifications/notifo/__init__.py | 1 + .../core/notifications/notifymyandroid/__init__.py | 1 + .../core/notifications/notifymywp/__init__.py | 1 + couchpotato/core/notifications/plex/__init__.py | 1 + couchpotato/core/notifications/prowl/__init__.py | 1 + .../core/notifications/pushover/__init__.py | 1 + .../core/notifications/synoindex/__init__.py | 1 + couchpotato/core/notifications/toasty/__init__.py | 1 + couchpotato/core/notifications/twitter/__init__.py | 1 + couchpotato/core/notifications/xbmc/__init__.py | 1 + couchpotato/core/providers/automation/__init__.py | 21 +++++++ .../core/providers/automation/bluray/__init__.py | 1 + .../core/providers/automation/imdb/__init__.py | 1 + .../core/providers/automation/itunes/__init__.py | 1 + .../providers/automation/kinepolis/__init__.py | 1 + .../providers/automation/moviemeter/__init__.py | 1 + .../providers/automation/movies_io/__init__.py | 1 + .../automation/rottentomatoes/__init__.py | 1 + .../core/providers/automation/trakt/__init__.py | 1 + couchpotato/core/providers/nzb/__init__.py | 14 +++++ .../core/providers/nzb/binsearch/__init__.py | 3 +- .../core/providers/nzb/ftdworld/__init__.py | 3 +- couchpotato/core/providers/nzb/newznab/__init__.py | 3 +- couchpotato/core/providers/nzb/nzbclub/__init__.py | 3 +- .../core/providers/nzb/nzbindex/__init__.py | 3 +- couchpotato/core/providers/nzb/nzbsrus/__init__.py | 3 +- couchpotato/core/providers/nzb/nzbx/__init__.py | 3 +- .../core/providers/nzb/omgwtfnzbs/__init__.py | 3 +- couchpotato/core/providers/torrent/__init__.py | 14 +++++ .../providers/torrent/kickasstorrents/__init__.py | 3 +- .../providers/torrent/passthepopcorn/__init__.py | 3 +- .../core/providers/torrent/publichd/__init__.py | 3 +- .../core/providers/torrent/sceneaccess/__init__.py | 3 +- .../core/providers/torrent/scenehd/__init__.py | 3 +- .../providers/torrent/thepiratebay/__init__.py | 3 +- .../core/providers/torrent/torrentday/__init__.py | 3 +- .../providers/torrent/torrentleech/__init__.py | 3 +- couchpotato/static/scripts/page/settings.js | 37 +++++++++-- couchpotato/static/style/page/settings.css | 73 +++++++++++++++++++++- 54 files changed, 253 insertions(+), 22 deletions(-) diff --git a/couchpotato/core/downloaders/__init__.py b/couchpotato/core/downloaders/__init__.py index e69de29..5fb7125 100644 --- a/couchpotato/core/downloaders/__init__.py +++ b/couchpotato/core/downloaders/__init__.py @@ -0,0 +1,13 @@ +config = { + 'name': 'download_providers', + 'groups': [ + { + 'label': 'Downloaders', + 'description': 'You can select different downloaders for each type (usenet / torrent)', + 'type': 'list', + 'name': 'download_providers', + 'tab': 'downloaders', + 'options': [], + }, + ], +} diff --git a/couchpotato/core/downloaders/blackhole/__init__.py b/couchpotato/core/downloaders/blackhole/__init__.py index 71649df..290e8d4 100644 --- a/couchpotato/core/downloaders/blackhole/__init__.py +++ b/couchpotato/core/downloaders/blackhole/__init__.py @@ -10,6 +10,7 @@ config = [{ 'groups': [ { 'tab': 'downloaders', + 'list': 'download_providers', 'name': 'blackhole', 'label': 'Black hole', 'description': 'Download the NZB/Torrent to a specific folder.', diff --git a/couchpotato/core/downloaders/nzbget/__init__.py b/couchpotato/core/downloaders/nzbget/__init__.py index 4fdac26..403a7e7 100644 --- a/couchpotato/core/downloaders/nzbget/__init__.py +++ b/couchpotato/core/downloaders/nzbget/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'downloaders', + 'list': 'download_providers', 'name': 'nzbget', 'label': 'NZBGet', 'description': 'Use NZBGet to download NZBs.', diff --git a/couchpotato/core/downloaders/nzbvortex/__init__.py b/couchpotato/core/downloaders/nzbvortex/__init__.py index e0e7746..f1604ea 100644 --- a/couchpotato/core/downloaders/nzbvortex/__init__.py +++ b/couchpotato/core/downloaders/nzbvortex/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'downloaders', + 'list': 'download_providers', 'name': 'nzbvortex', 'label': 'NZBVortex', 'description': 'Use NZBVortex to download NZBs.', diff --git a/couchpotato/core/downloaders/pneumatic/__init__.py b/couchpotato/core/downloaders/pneumatic/__init__.py index f119cfc..96574a7 100644 --- a/couchpotato/core/downloaders/pneumatic/__init__.py +++ b/couchpotato/core/downloaders/pneumatic/__init__.py @@ -9,6 +9,7 @@ config = [{ 'groups': [ { 'tab': 'downloaders', + 'list': 'download_providers', 'name': 'pneumatic', 'label': 'Pneumatic', 'description': 'Use Pneumatic to download .strm files.', diff --git a/couchpotato/core/downloaders/sabnzbd/__init__.py b/couchpotato/core/downloaders/sabnzbd/__init__.py index e416250..6c976f1 100644 --- a/couchpotato/core/downloaders/sabnzbd/__init__.py +++ b/couchpotato/core/downloaders/sabnzbd/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'downloaders', + 'list': 'download_providers', 'name': 'sabnzbd', 'label': 'Sabnzbd', 'description': 'Use SABnzbd to download NZBs.', diff --git a/couchpotato/core/downloaders/synology/__init__.py b/couchpotato/core/downloaders/synology/__init__.py index 2b7e861..00a135d 100644 --- a/couchpotato/core/downloaders/synology/__init__.py +++ b/couchpotato/core/downloaders/synology/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'downloaders', + 'list': 'download_providers', 'name': 'synology', 'label': 'Synology', 'description': 'Use Synology Download Station to download.', diff --git a/couchpotato/core/downloaders/transmission/__init__.py b/couchpotato/core/downloaders/transmission/__init__.py index 0fe1184..210a0d9 100644 --- a/couchpotato/core/downloaders/transmission/__init__.py +++ b/couchpotato/core/downloaders/transmission/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'downloaders', + 'list': 'download_providers', 'name': 'transmission', 'label': 'Transmission', 'description': 'Use Transmission to download torrents.', diff --git a/couchpotato/core/downloaders/utorrent/__init__.py b/couchpotato/core/downloaders/utorrent/__init__.py index 09a82a1..2c494eb 100644 --- a/couchpotato/core/downloaders/utorrent/__init__.py +++ b/couchpotato/core/downloaders/utorrent/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'downloaders', + 'list': 'download_providers', 'name': 'utorrent', 'label': 'uTorrent', 'description': 'Use uTorrent to download torrents.', diff --git a/couchpotato/core/loader.py b/couchpotato/core/loader.py index 3039519..a97437a 100644 --- a/couchpotato/core/loader.py +++ b/couchpotato/core/loader.py @@ -67,6 +67,18 @@ class Loader(object): def addFromDir(self, plugin_type, priority, module, dir_name): + # Load dir module + try: + m = __import__(module) + splitted = module.split('.') + for sub in splitted[1:]: + m = getattr(m, sub) + + if hasattr(m, 'config'): + fireEvent('settings.options', splitted[-1] + '_config', getattr(m, 'config')) + except: + raise + for cur_file in glob.glob(os.path.join(dir_name, '*')): name = os.path.basename(cur_file) if os.path.isdir(os.path.join(dir_name, name)): diff --git a/couchpotato/core/notifications/__init__.py b/couchpotato/core/notifications/__init__.py index e69de29..8ac24df 100644 --- a/couchpotato/core/notifications/__init__.py +++ b/couchpotato/core/notifications/__init__.py @@ -0,0 +1,13 @@ +config = { + 'name': 'notification_providers', + 'groups': [ + { + 'label': 'Notifications', + 'description': 'Notify when movies are done or snatched', + 'type': 'list', + 'name': 'notification_providers', + 'tab': 'notifications', + 'options': [], + }, + ], +} diff --git a/couchpotato/core/notifications/boxcar/__init__.py b/couchpotato/core/notifications/boxcar/__init__.py index f83722f..ab244c3 100644 --- a/couchpotato/core/notifications/boxcar/__init__.py +++ b/couchpotato/core/notifications/boxcar/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'boxcar', 'options': [ { diff --git a/couchpotato/core/notifications/email/__init__.py b/couchpotato/core/notifications/email/__init__.py index ed55528..b41cc8e 100644 --- a/couchpotato/core/notifications/email/__init__.py +++ b/couchpotato/core/notifications/email/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'email', 'options': [ { diff --git a/couchpotato/core/notifications/growl/__init__.py b/couchpotato/core/notifications/growl/__init__.py index 82a6636..8e46223 100644 --- a/couchpotato/core/notifications/growl/__init__.py +++ b/couchpotato/core/notifications/growl/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'growl', 'description': 'Version 1.4+', 'options': [ diff --git a/couchpotato/core/notifications/nmj/__init__.py b/couchpotato/core/notifications/nmj/__init__.py index 6fac5ee..08a21a3 100644 --- a/couchpotato/core/notifications/nmj/__init__.py +++ b/couchpotato/core/notifications/nmj/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'nmj', 'label': 'NMJ', 'options': [ diff --git a/couchpotato/core/notifications/notifo/__init__.py b/couchpotato/core/notifications/notifo/__init__.py index 5bf035c..941246c 100644 --- a/couchpotato/core/notifications/notifo/__init__.py +++ b/couchpotato/core/notifications/notifo/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'notifo', 'description': 'Keep in mind that Notifo service will end soon.', 'options': [ diff --git a/couchpotato/core/notifications/notifymyandroid/__init__.py b/couchpotato/core/notifications/notifymyandroid/__init__.py index 58f8e62..9ee5d90 100644 --- a/couchpotato/core/notifications/notifymyandroid/__init__.py +++ b/couchpotato/core/notifications/notifymyandroid/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'notifymyandroid', 'label': 'Notify My Android', 'options': [ diff --git a/couchpotato/core/notifications/notifymywp/__init__.py b/couchpotato/core/notifications/notifymywp/__init__.py index 76228e6..4e52761 100644 --- a/couchpotato/core/notifications/notifymywp/__init__.py +++ b/couchpotato/core/notifications/notifymywp/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'notifymywp', 'label': 'Notify My Windows Phone', 'options': [ diff --git a/couchpotato/core/notifications/plex/__init__.py b/couchpotato/core/notifications/plex/__init__.py index f908cbb..8d89a40 100644 --- a/couchpotato/core/notifications/plex/__init__.py +++ b/couchpotato/core/notifications/plex/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'plex', 'options': [ { diff --git a/couchpotato/core/notifications/prowl/__init__.py b/couchpotato/core/notifications/prowl/__init__.py index 5884f74..e056428 100644 --- a/couchpotato/core/notifications/prowl/__init__.py +++ b/couchpotato/core/notifications/prowl/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'prowl', 'options': [ { diff --git a/couchpotato/core/notifications/pushover/__init__.py b/couchpotato/core/notifications/pushover/__init__.py index d8d76b7..1ea1d5c 100644 --- a/couchpotato/core/notifications/pushover/__init__.py +++ b/couchpotato/core/notifications/pushover/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'pushover', 'options': [ { diff --git a/couchpotato/core/notifications/synoindex/__init__.py b/couchpotato/core/notifications/synoindex/__init__.py index af47623..eb3a793 100644 --- a/couchpotato/core/notifications/synoindex/__init__.py +++ b/couchpotato/core/notifications/synoindex/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'synoindex', 'description': 'Automaticly adds index to Synology Media Server.', 'options': [ diff --git a/couchpotato/core/notifications/toasty/__init__.py b/couchpotato/core/notifications/toasty/__init__.py index 25d27ec..8e2dae7 100644 --- a/couchpotato/core/notifications/toasty/__init__.py +++ b/couchpotato/core/notifications/toasty/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'toasty', 'options': [ { diff --git a/couchpotato/core/notifications/twitter/__init__.py b/couchpotato/core/notifications/twitter/__init__.py index 5910b0a..9db8dcb 100644 --- a/couchpotato/core/notifications/twitter/__init__.py +++ b/couchpotato/core/notifications/twitter/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'twitter', 'options': [ { diff --git a/couchpotato/core/notifications/xbmc/__init__.py b/couchpotato/core/notifications/xbmc/__init__.py index ee2b4cc..0753c82 100644 --- a/couchpotato/core/notifications/xbmc/__init__.py +++ b/couchpotato/core/notifications/xbmc/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'notifications', + 'list': 'notification_providers', 'name': 'xbmc', 'label': 'XBMC', 'description': 'v11 (Eden) and v12 (Frodo)', diff --git a/couchpotato/core/providers/automation/__init__.py b/couchpotato/core/providers/automation/__init__.py index e69de29..a217948 100644 --- a/couchpotato/core/providers/automation/__init__.py +++ b/couchpotato/core/providers/automation/__init__.py @@ -0,0 +1,21 @@ +config = { + 'name': 'automation_providers', + 'groups': [ + { + 'label': 'Watchlists', + 'description': 'Check watchlists for new movies', + 'type': 'list', + 'name': 'watchlist_providers', + 'tab': 'automation', + 'options': [], + }, + { + 'label': 'Automated', + 'description': 'Uses minimal requirements', + 'type': 'list', + 'name': 'automation_providers', + 'tab': 'automation', + 'options': [], + }, + ], +} diff --git a/couchpotato/core/providers/automation/bluray/__init__.py b/couchpotato/core/providers/automation/bluray/__init__.py index 6e9d831..b916b0a 100644 --- a/couchpotato/core/providers/automation/bluray/__init__.py +++ b/couchpotato/core/providers/automation/bluray/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'automation', + 'list': 'automation_providers', 'name': 'bluray_automation', 'label': 'Blu-ray.com', 'description': 'Imports movies from blu-ray.com. (uses minimal requirements)', diff --git a/couchpotato/core/providers/automation/imdb/__init__.py b/couchpotato/core/providers/automation/imdb/__init__.py index 925138d..8a91d42 100644 --- a/couchpotato/core/providers/automation/imdb/__init__.py +++ b/couchpotato/core/providers/automation/imdb/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'automation', + 'list': 'watchlist_providers', 'name': 'imdb_automation', 'label': 'IMDB', 'description': 'From any public IMDB watchlists. Url should be the RSS link.', diff --git a/couchpotato/core/providers/automation/itunes/__init__.py b/couchpotato/core/providers/automation/itunes/__init__.py index 368c1e4..b5c565f 100644 --- a/couchpotato/core/providers/automation/itunes/__init__.py +++ b/couchpotato/core/providers/automation/itunes/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'automation', + 'list': 'automation_providers', 'name': 'itunes_automation', 'label': 'iTunes', 'description': 'From any iTunes Store feed. Url should be the RSS link. (uses minimal requirements)', diff --git a/couchpotato/core/providers/automation/kinepolis/__init__.py b/couchpotato/core/providers/automation/kinepolis/__init__.py index eea3601..d3b8e89 100644 --- a/couchpotato/core/providers/automation/kinepolis/__init__.py +++ b/couchpotato/core/providers/automation/kinepolis/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'automation', + 'list': 'automation_providers', 'name': 'kinepolis_automation', 'label': 'Kinepolis', 'description': 'Imports movies from the current top 10 of kinepolis. (uses minimal requirements)', diff --git a/couchpotato/core/providers/automation/moviemeter/__init__.py b/couchpotato/core/providers/automation/moviemeter/__init__.py index 8ea7c06..773bed4 100644 --- a/couchpotato/core/providers/automation/moviemeter/__init__.py +++ b/couchpotato/core/providers/automation/moviemeter/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'automation', + 'list': 'automation_providers', 'name': 'moviemeter_automation', 'label': 'Moviemeter', 'description': 'Imports movies from the current top 10 of moviemeter.nl. (uses minimal requirements)', diff --git a/couchpotato/core/providers/automation/movies_io/__init__.py b/couchpotato/core/providers/automation/movies_io/__init__.py index 5d997e9..9b28093 100644 --- a/couchpotato/core/providers/automation/movies_io/__init__.py +++ b/couchpotato/core/providers/automation/movies_io/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'automation', + 'list': 'watchlist_providers', 'name': 'moviesio', 'label': 'Movies.IO', 'description': 'Imports movies from Movies.io RSS watchlists', diff --git a/couchpotato/core/providers/automation/rottentomatoes/__init__.py b/couchpotato/core/providers/automation/rottentomatoes/__init__.py index f3c1291..dd96fe4 100644 --- a/couchpotato/core/providers/automation/rottentomatoes/__init__.py +++ b/couchpotato/core/providers/automation/rottentomatoes/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'automation', + 'list': 'automation_providers', 'name': 'rottentomatoes_automation', 'label': 'Rottentomatoes', 'description': 'Imports movies from the rottentomatoes "in theaters"-feed.', diff --git a/couchpotato/core/providers/automation/trakt/__init__.py b/couchpotato/core/providers/automation/trakt/__init__.py index fca7af3..cbaaece 100644 --- a/couchpotato/core/providers/automation/trakt/__init__.py +++ b/couchpotato/core/providers/automation/trakt/__init__.py @@ -8,6 +8,7 @@ config = [{ 'groups': [ { 'tab': 'automation', + 'list': 'watchlist_providers', 'name': 'trakt_automation', 'label': 'Trakt', 'description': 'import movies from your own watchlist', diff --git a/couchpotato/core/providers/nzb/__init__.py b/couchpotato/core/providers/nzb/__init__.py index e69de29..a704a94 100644 --- a/couchpotato/core/providers/nzb/__init__.py +++ b/couchpotato/core/providers/nzb/__init__.py @@ -0,0 +1,14 @@ +config = { + 'name': 'nzb_providers', + 'groups': [ + { + 'label': 'Usenet', + 'description': 'Providers searching usenet for new releases', + 'type': 'list', + 'name': 'nzb_providers', + 'tab': 'searcher', + 'subtab': 'providers', + 'options': [], + }, + ], +} diff --git a/couchpotato/core/providers/nzb/binsearch/__init__.py b/couchpotato/core/providers/nzb/binsearch/__init__.py index 42281ec..bf45f66 100644 --- a/couchpotato/core/providers/nzb/binsearch/__init__.py +++ b/couchpotato/core/providers/nzb/binsearch/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'nzb_providers', + 'subtab': 'providers', + 'list': 'nzb_providers', 'name': 'binsearch', 'description': 'Free provider, less accurate. See BinSearch', 'options': [ diff --git a/couchpotato/core/providers/nzb/ftdworld/__init__.py b/couchpotato/core/providers/nzb/ftdworld/__init__.py index e11f486..7698564 100644 --- a/couchpotato/core/providers/nzb/ftdworld/__init__.py +++ b/couchpotato/core/providers/nzb/ftdworld/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'nzb_providers', + 'subtab': 'providers', + 'list': 'nzb_providers', 'name': 'FTDWorld', 'description': 'Free provider, less accurate. See FTDWorld', 'options': [ diff --git a/couchpotato/core/providers/nzb/newznab/__init__.py b/couchpotato/core/providers/nzb/newznab/__init__.py index 1e76d1c..9047d20 100644 --- a/couchpotato/core/providers/nzb/newznab/__init__.py +++ b/couchpotato/core/providers/nzb/newznab/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'nzb_providers', + 'subtab': 'providers', + 'list': 'nzb_providers', 'name': 'newznab', 'order': 10, 'description': 'Enable NewzNab providers such as NZB.su, \ diff --git a/couchpotato/core/providers/nzb/nzbclub/__init__.py b/couchpotato/core/providers/nzb/nzbclub/__init__.py index c7cf8d9..310f4b0 100644 --- a/couchpotato/core/providers/nzb/nzbclub/__init__.py +++ b/couchpotato/core/providers/nzb/nzbclub/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'nzb_providers', + 'subtab': 'providers', + 'list': 'nzb_providers', 'name': 'NZBClub', 'description': 'Free provider, less accurate. See NZBClub', 'options': [ diff --git a/couchpotato/core/providers/nzb/nzbindex/__init__.py b/couchpotato/core/providers/nzb/nzbindex/__init__.py index 04d5022..bad0557 100644 --- a/couchpotato/core/providers/nzb/nzbindex/__init__.py +++ b/couchpotato/core/providers/nzb/nzbindex/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'nzb_providers', + 'subtab': 'providers', + 'list': 'nzb_providers', 'name': 'nzbindex', 'description': 'Free provider, less accurate. See NZBIndex', 'options': [ diff --git a/couchpotato/core/providers/nzb/nzbsrus/__init__.py b/couchpotato/core/providers/nzb/nzbsrus/__init__.py index cd4d669..5c4586d 100644 --- a/couchpotato/core/providers/nzb/nzbsrus/__init__.py +++ b/couchpotato/core/providers/nzb/nzbsrus/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'nzb_providers', + 'subtab': 'providers', + 'list': 'nzb_providers', 'name': 'nzbsrus', 'label': 'Nzbsrus', 'description': 'See NZBsRus', diff --git a/couchpotato/core/providers/nzb/nzbx/__init__.py b/couchpotato/core/providers/nzb/nzbx/__init__.py index f1c7d58..2063a5e 100644 --- a/couchpotato/core/providers/nzb/nzbx/__init__.py +++ b/couchpotato/core/providers/nzb/nzbx/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'nzb_providers', + 'subtab': 'providers', + 'list': 'nzb_providers', 'name': 'nzbX', 'description': 'Free provider. See nzbX', 'options': [ diff --git a/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py b/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py index 089b72c..74fee0a 100644 --- a/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py +++ b/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'nzb_providers', + 'subtab': 'providers', + 'list': 'nzb_providers', 'name': 'OMGWTFNZBs', 'description': 'See OMGWTFNZBs', 'options': [ diff --git a/couchpotato/core/providers/torrent/__init__.py b/couchpotato/core/providers/torrent/__init__.py index e69de29..df6cd9a 100644 --- a/couchpotato/core/providers/torrent/__init__.py +++ b/couchpotato/core/providers/torrent/__init__.py @@ -0,0 +1,14 @@ +config = { + 'name': 'torrent_providers', + 'groups': [ + { + 'label': 'Torrent', + 'description': 'Providers searching torrent sites for new releases', + 'type': 'list', + 'name': 'torrent_providers', + 'tab': 'searcher', + 'subtab': 'providers', + 'options': [], + }, + ], +} diff --git a/couchpotato/core/providers/torrent/kickasstorrents/__init__.py b/couchpotato/core/providers/torrent/kickasstorrents/__init__.py index d31250f..8ddb1f4 100644 --- a/couchpotato/core/providers/torrent/kickasstorrents/__init__.py +++ b/couchpotato/core/providers/torrent/kickasstorrents/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'torrent_providers', + 'subtab': 'providers', + 'list': 'torrent_providers', 'name': 'KickAssTorrents', 'description': 'See KickAssTorrents', 'wizard': True, diff --git a/couchpotato/core/providers/torrent/passthepopcorn/__init__.py b/couchpotato/core/providers/torrent/passthepopcorn/__init__.py index 3291c9c..ce9d382 100644 --- a/couchpotato/core/providers/torrent/passthepopcorn/__init__.py +++ b/couchpotato/core/providers/torrent/passthepopcorn/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'torrent_providers', + 'subtab': 'providers', + 'list': 'torrent_providers', 'name': 'PassThePopcorn', 'description': 'See PassThePopcorn.me', 'options': [ diff --git a/couchpotato/core/providers/torrent/publichd/__init__.py b/couchpotato/core/providers/torrent/publichd/__init__.py index b0d3b70..06be335 100644 --- a/couchpotato/core/providers/torrent/publichd/__init__.py +++ b/couchpotato/core/providers/torrent/publichd/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'torrent_providers', + 'subtab': 'providers', + 'list': 'torrent_providers', 'name': 'PublicHD', 'description': 'Public Torrent site with only HD content. See PublicHD', 'options': [ diff --git a/couchpotato/core/providers/torrent/sceneaccess/__init__.py b/couchpotato/core/providers/torrent/sceneaccess/__init__.py index e59f89b..1361482 100644 --- a/couchpotato/core/providers/torrent/sceneaccess/__init__.py +++ b/couchpotato/core/providers/torrent/sceneaccess/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'torrent_providers', + 'subtab': 'providers', + 'list': 'torrent_providers', 'name': 'SceneAccess', 'description': 'See SceneAccess', 'options': [ diff --git a/couchpotato/core/providers/torrent/scenehd/__init__.py b/couchpotato/core/providers/torrent/scenehd/__init__.py index 69cf8a1..032e705 100644 --- a/couchpotato/core/providers/torrent/scenehd/__init__.py +++ b/couchpotato/core/providers/torrent/scenehd/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'torrent_providers', + 'subtab': 'providers', + 'list': 'torrent_providers', 'name': 'SceneHD', 'description': 'See SceneHD', 'options': [ diff --git a/couchpotato/core/providers/torrent/thepiratebay/__init__.py b/couchpotato/core/providers/torrent/thepiratebay/__init__.py index f890ca0..3816908 100644 --- a/couchpotato/core/providers/torrent/thepiratebay/__init__.py +++ b/couchpotato/core/providers/torrent/thepiratebay/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'torrent_providers', + 'subtab': 'providers', + 'list': 'torrent_providers', 'name': 'ThePirateBay', 'description': 'The world\'s largest bittorrent tracker. See ThePirateBay', 'wizard': True, diff --git a/couchpotato/core/providers/torrent/torrentday/__init__.py b/couchpotato/core/providers/torrent/torrentday/__init__.py index 8ffd48c..2ebf0d9 100644 --- a/couchpotato/core/providers/torrent/torrentday/__init__.py +++ b/couchpotato/core/providers/torrent/torrentday/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'torrent_providers', + 'subtab': 'providers', + 'list': 'torrent_providers', 'name': 'TorrentDay', 'description': 'See TorrentDay', 'options': [ diff --git a/couchpotato/core/providers/torrent/torrentleech/__init__.py b/couchpotato/core/providers/torrent/torrentleech/__init__.py index b808a00..5d1de87 100644 --- a/couchpotato/core/providers/torrent/torrentleech/__init__.py +++ b/couchpotato/core/providers/torrent/torrentleech/__init__.py @@ -8,7 +8,8 @@ config = [{ 'groups': [ { 'tab': 'searcher', - 'subtab': 'torrent_providers', + 'subtab': 'providers', + 'list': 'torrent_providers', 'name': 'TorrentLeech', 'description': 'See TorrentLeech', 'options': [ diff --git a/couchpotato/static/scripts/page/settings.js b/couchpotato/static/scripts/page/settings.js index 11f1aa4..a050b3f 100644 --- a/couchpotato/static/scripts/page/settings.js +++ b/couchpotato/static/scripts/page/settings.js @@ -7,6 +7,7 @@ Page.Settings = new Class({ wizard_only: false, tabs: {}, + lists: {}, current: 'about', has_tab: false, @@ -178,12 +179,24 @@ Page.Settings = new Class({ var content_container = self.tabs[group.tab].subtabs[group.subtab].content } + if(group.list && !self.lists[group.list]){ + self.lists[group.list] = self.createList(content_container); + } + // Create the group if(!self.tabs[group.tab].groups[group.name]){ var group_el = self.createGroup(group) - .inject(content_container) + .inject(group.list ? self.lists[group.list] : content_container) .addClass('section_'+section_name); - self.tabs[group.tab].groups[group.name] = group_el + self.tabs[group.tab].groups[group.name] = group_el; + } + + // Create list if needed + if(group.type && group.type == 'list'){ + if(!self.lists[group.name]) + self.lists[group.name] = self.createList(content_container); + else + self.lists[group.name].inject(self.tabs[group.tab].groups[group.name]); } // Add options to group @@ -283,6 +296,14 @@ Page.Settings = new Class({ ) return group_el + }, + + createList: function(content_container){ + return new Element('div.option_list').grab( + new Element('h3', { + 'text': 'Enable more providers' + }) + ).inject(content_container) } }); @@ -550,15 +571,21 @@ Option.Enabler = new Class({ }, checkState: function(){ - var self = this; + var self = this, + enabled = self.getValue(); + + self.parentFieldset[ enabled ? 'removeClass' : 'addClass']('disabled'); + + if(self.parentList) + self.parentFieldset.inject(self.parentList.getElement('h3'), enabled ? 'before' : 'after'); - self.parentFieldset[ self.getValue() ? 'removeClass' : 'addClass']('disabled'); }, afterInject: function(){ var self = this; - self.parentFieldset = self.el.getParent('fieldset') + self.parentFieldset = self.el.getParent('fieldset').addClass('enabler') + self.parentList = self.parentFieldset.getParent('.option_list'); self.el.inject(self.parentFieldset, 'top') self.checkState() } diff --git a/couchpotato/static/style/page/settings.css b/couchpotato/static/style/page/settings.css index 571e5a6..b9c9ea4 100644 --- a/couchpotato/static/style/page/settings.css +++ b/couchpotato/static/style/page/settings.css @@ -92,6 +92,10 @@ font-size: 12px; margin-left: 10px; } + .page fieldset h2 .hint a { + margin: 0 !important; + padding: 0; + } .page fieldset.disabled .ctrlHolder { display: none; @@ -102,7 +106,7 @@ width: auto; margin: 0; position: relative; - margin-bottom: -25px; + margin-bottom: -23px; border: none; width: 20px; } @@ -148,6 +152,73 @@ } .page .xsmall { width: 20px !important; text-align: center; } + + .page .enabler { + display: block; + } + + .page .option_list { + margin-bottom: 20px; + } + + .page .option_list .enabler { + padding: 0; + } + + .page .option_list .enabler:not(.disabled) { + margin: 0 0 0 30px; + } + + .page .option_list .enabler:not(.disabled) .ctrlHolder:first-child { + margin: 10px 0 -33px 0; + } + + .page .option_list h3 { + padding: 0; + margin: 10px 0 0 0; + text-align: center; + font-weight: normal; + text-shadow: none; + text-transform: uppercase; + font-size: 12px; + background: rgba(255,255,255,0.03); + } + + .page .option_list .enabler.disabled { + display: inline-block; + margin: 3px 3px 3px 20px; + padding: 4px 0; + width: 159px; + vertical-align: top; + } + + .page .option_list .enabler.disabled h2 { + border: none; + box-shadow: none; + padding: 0 10px 0 25px; + font-size: 16px; + } + + .page .option_list .enabler:not(.disabled) h2 { + font-size: 16px; + font-weight: bold; + border: none; + border-top: 1px solid rgba(255,255,255, 0.15); + box-shadow: 0 -1px 0px #333; + margin: 0; + padding: 10px 0 5px 25px; + } + .page .option_list .enabler:not(.disabled):first-child h2 { + border: none; + box-shadow: none; + } + + .page .option_list .enabler.disabled h2 .hint { + display: none; + } + .page .option_list .enabler h2 .hint { + font-weight: normal; + } .page input[type=text], .page input[type=password] { padding: 5px 3px;