diff --git a/couchpotato/core/plugins/score/scores.py b/couchpotato/core/plugins/score/scores.py index 3d5a9e69..c9345fc0 100644 --- a/couchpotato/core/plugins/score/scores.py +++ b/couchpotato/core/plugins/score/scores.py @@ -116,13 +116,13 @@ def sizeScore(size): def providerScore(provider): - if provider in ['OMGWTFNZBs', 'PassThePopcorn', 'SceneAccess', 'TorrentLeech']: - return 20 - if provider in ['Newznab']: - return 10 + try: + score = tryInt(Env.setting('extra_score', section = provider.lower(), default = 0)) + except: + score = 0 - return 0 + return score def duplicateScore(nzb_name, movie_name): diff --git a/couchpotato/core/providers/nzb/binsearch/__init__.py b/couchpotato/core/providers/nzb/binsearch/__init__.py index f4288b11..d3288604 100644 --- a/couchpotato/core/providers/nzb/binsearch/__init__.py +++ b/couchpotato/core/providers/nzb/binsearch/__init__.py @@ -18,6 +18,14 @@ config = [{ 'name': 'enabled', 'type': 'enabler', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/nzb/ftdworld/__init__.py b/couchpotato/core/providers/nzb/ftdworld/__init__.py index ca60ac4d..37aedb2a 100644 --- a/couchpotato/core/providers/nzb/ftdworld/__init__.py +++ b/couchpotato/core/providers/nzb/ftdworld/__init__.py @@ -27,6 +27,14 @@ config = [{ 'default': '', 'type': 'password', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/nzb/newznab/__init__.py b/couchpotato/core/providers/nzb/newznab/__init__.py index 9047d200..2349590f 100644 --- a/couchpotato/core/providers/nzb/newznab/__init__.py +++ b/couchpotato/core/providers/nzb/newznab/__init__.py @@ -30,13 +30,20 @@ config = [{ 'default': 'nzb.su,dognzb.cr,nzbs.org,https://index.nzbgeek.info', 'description': 'The hostname of your newznab provider', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'default': '0,0,0,0', + 'description': 'Starting score for each release found via this provider.', + }, { 'name': 'api_key', 'default': ',,,', 'label': 'Api Key', 'description': 'Can be found on your profile page', 'type': 'combined', - 'combine': ['use', 'host', 'api_key'], + 'combine': ['use', 'host', 'api_key', 'extra_score'], }, ], }, diff --git a/couchpotato/core/providers/nzb/newznab/main.py b/couchpotato/core/providers/nzb/newznab/main.py index 414e7112..11107c1f 100644 --- a/couchpotato/core/providers/nzb/newznab/main.py +++ b/couchpotato/core/providers/nzb/newznab/main.py @@ -1,6 +1,6 @@ from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.helpers.rss import RSS -from couchpotato.core.helpers.variable import cleanHost, splitString +from couchpotato.core.helpers.variable import cleanHost, splitString, tryInt from couchpotato.core.logger import CPLog from couchpotato.core.providers.base import ResultList from couchpotato.core.providers.nzb.base import NZBProvider @@ -76,6 +76,7 @@ class Newznab(NZBProvider, RSS): 'url': (self.getUrl(host['host'], self.urls['download']) % tryUrlencode(nzb_id)) + self.getApiExt(host), 'detail_url': '%sdetails/%s' % (cleanHost(host['host']), tryUrlencode(nzb_id)), 'content': self.getTextElement(nzb, 'description'), + 'score': host['extra_score'], }) def getHosts(self): @@ -83,13 +84,15 @@ class Newznab(NZBProvider, RSS): uses = splitString(str(self.conf('use'))) hosts = splitString(self.conf('host')) api_keys = splitString(self.conf('api_key')) + extra_score = splitString(self.conf('extra_score')) list = [] for nr in range(len(hosts)): list.append({ 'use': uses[nr], 'host': hosts[nr], - 'api_key': api_keys[nr] + 'api_key': api_keys[nr], + 'extra_score': tryInt(extra_score[nr]) if len(extra_score) > nr else 0 }) return list diff --git a/couchpotato/core/providers/nzb/nzbclub/__init__.py b/couchpotato/core/providers/nzb/nzbclub/__init__.py index 7859fe9c..9955462c 100644 --- a/couchpotato/core/providers/nzb/nzbclub/__init__.py +++ b/couchpotato/core/providers/nzb/nzbclub/__init__.py @@ -18,6 +18,14 @@ config = [{ 'name': 'enabled', 'type': 'enabler', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/nzb/nzbindex/__init__.py b/couchpotato/core/providers/nzb/nzbindex/__init__.py index 29eb0d38..aa8de4dd 100644 --- a/couchpotato/core/providers/nzb/nzbindex/__init__.py +++ b/couchpotato/core/providers/nzb/nzbindex/__init__.py @@ -19,6 +19,14 @@ config = [{ 'type': 'enabler', 'default': True, }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/nzb/nzbsrus/__init__.py b/couchpotato/core/providers/nzb/nzbsrus/__init__.py index 3a042784..863e6a37 100644 --- a/couchpotato/core/providers/nzb/nzbsrus/__init__.py +++ b/couchpotato/core/providers/nzb/nzbsrus/__init__.py @@ -35,6 +35,14 @@ config = [{ 'label': 'English only', 'description': 'Only search for English spoken movies on Nzbsrus', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/nzb/nzbx/__init__.py b/couchpotato/core/providers/nzb/nzbx/__init__.py index 9ce9226b..9cf80638 100644 --- a/couchpotato/core/providers/nzb/nzbx/__init__.py +++ b/couchpotato/core/providers/nzb/nzbx/__init__.py @@ -19,6 +19,14 @@ config = [{ 'type': 'enabler', 'default': True, }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py b/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py index 287ced49..fe80518c 100644 --- a/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py +++ b/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py @@ -27,6 +27,14 @@ config = [{ 'label': 'Api Key', 'default': '', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'default': 20, + 'type': 'int', + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/torrent/iptorrents/__init__.py b/couchpotato/core/providers/torrent/iptorrents/__init__.py index bca8ce69..24f9772b 100644 --- a/couchpotato/core/providers/torrent/iptorrents/__init__.py +++ b/couchpotato/core/providers/torrent/iptorrents/__init__.py @@ -34,6 +34,14 @@ config = [{ 'type': 'bool', 'description': 'Only search for [FreeLeech] torrents.', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/torrent/kickasstorrents/__init__.py b/couchpotato/core/providers/torrent/kickasstorrents/__init__.py index 8ddb1f4a..999dbb1b 100644 --- a/couchpotato/core/providers/torrent/kickasstorrents/__init__.py +++ b/couchpotato/core/providers/torrent/kickasstorrents/__init__.py @@ -19,6 +19,14 @@ config = [{ 'type': 'enabler', 'default': True, }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/torrent/passthepopcorn/__init__.py b/couchpotato/core/providers/torrent/passthepopcorn/__init__.py index 06be7a89..a9f687c3 100644 --- a/couchpotato/core/providers/torrent/passthepopcorn/__init__.py +++ b/couchpotato/core/providers/torrent/passthepopcorn/__init__.py @@ -37,6 +37,14 @@ config = [{ { 'name': 'passkey', 'default': '', + }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 20, + 'description': 'Starting score for each release found via this provider.', } ], } diff --git a/couchpotato/core/providers/torrent/publichd/__init__.py b/couchpotato/core/providers/torrent/publichd/__init__.py index 2c356e20..3c27cf48 100644 --- a/couchpotato/core/providers/torrent/publichd/__init__.py +++ b/couchpotato/core/providers/torrent/publichd/__init__.py @@ -19,6 +19,14 @@ config = [{ 'type': 'enabler', 'default': True, }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/torrent/sceneaccess/__init__.py b/couchpotato/core/providers/torrent/sceneaccess/__init__.py index e12bf8bd..baad57f6 100644 --- a/couchpotato/core/providers/torrent/sceneaccess/__init__.py +++ b/couchpotato/core/providers/torrent/sceneaccess/__init__.py @@ -28,6 +28,14 @@ config = [{ 'default': '', 'type': 'password', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 20, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/torrent/scenehd/__init__.py b/couchpotato/core/providers/torrent/scenehd/__init__.py index 10c5e385..3cd2132e 100644 --- a/couchpotato/core/providers/torrent/scenehd/__init__.py +++ b/couchpotato/core/providers/torrent/scenehd/__init__.py @@ -28,6 +28,14 @@ config = [{ 'default': '', 'type': 'password', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/torrent/thepiratebay/__init__.py b/couchpotato/core/providers/torrent/thepiratebay/__init__.py index 38169084..f2394dd6 100644 --- a/couchpotato/core/providers/torrent/thepiratebay/__init__.py +++ b/couchpotato/core/providers/torrent/thepiratebay/__init__.py @@ -24,6 +24,14 @@ config = [{ 'advanced': True, 'label': 'Proxy server', 'description': 'Domain for requests, keep empty to let CouchPotato pick.', + }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', } ], } diff --git a/couchpotato/core/providers/torrent/torrentday/__init__.py b/couchpotato/core/providers/torrent/torrentday/__init__.py index 1a4d3c7f..de715b53 100644 --- a/couchpotato/core/providers/torrent/torrentday/__init__.py +++ b/couchpotato/core/providers/torrent/torrentday/__init__.py @@ -28,6 +28,14 @@ config = [{ 'default': '', 'type': 'password', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 0, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/core/providers/torrent/torrentleech/__init__.py b/couchpotato/core/providers/torrent/torrentleech/__init__.py index d96ac064..fa048d50 100644 --- a/couchpotato/core/providers/torrent/torrentleech/__init__.py +++ b/couchpotato/core/providers/torrent/torrentleech/__init__.py @@ -28,6 +28,14 @@ config = [{ 'default': '', 'type': 'password', }, + { + 'name': 'extra_score', + 'advanced': True, + 'label': 'Extra Score', + 'type': 'int', + 'default': 20, + 'description': 'Starting score for each release found via this provider.', + } ], }, ], diff --git a/couchpotato/static/style/settings.css b/couchpotato/static/style/settings.css index 6d3a8eb6..a5655f88 100644 --- a/couchpotato/static/style/settings.css +++ b/couchpotato/static/style/settings.css @@ -515,8 +515,21 @@ display: none; } .page .combined_table .head abbr.host { - margin-right: 197px; + margin-right: 190px; } + .page .combined_table .head abbr.api_key { + margin-right: 171px; + } + .page .combined_table .head .extra_score, + .page .combined_table .extra_score { + width: 70px; + text-align: center; + display: none; + } + .page.show_advanced .combined_table .head .extra_score, + .page.show_advanced .combined_table .extra_score { + display: inline-block; + } .page .combined_table .ctrlHolder { padding-top: 2px;