From 8d2e3a1919db73ae4536c69a18870a64e3cbc0cf Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 24 Nov 2013 21:43:54 +0100 Subject: [PATCH] Add ratio and seed time styling --- .../torrent/torrentpotato/__init__.py | 8 ++-- .../providers/torrent/torrentpotato/main.py | 8 ++-- couchpotato/static/style/settings.css | 42 ++++++++++--------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/couchpotato/core/providers/torrent/torrentpotato/__init__.py b/couchpotato/core/providers/torrent/torrentpotato/__init__.py index fab6d178..5054f98c 100644 --- a/couchpotato/core/providers/torrent/torrentpotato/__init__.py +++ b/couchpotato/core/providers/torrent/torrentpotato/__init__.py @@ -43,15 +43,13 @@ config = [{ { 'name': 'seed_ratio', 'label': 'Seed ratio', - 'type': 'float', - 'default': 1, + 'default': '1', 'description': 'Will not be (re)moved until this seed ratio is met.', }, { 'name': 'seed_time', 'label': 'Seed time', - 'type': 'int', - 'default': 40, + 'default': '40', 'description': 'Will not be (re)moved until this seed time (in hours) is met.', }, { @@ -60,7 +58,7 @@ config = [{ 'label': 'Pass Key', 'description': 'Can be found on your profile page', 'type': 'combined', - 'combine': ['use', 'host', 'pass_key', 'name', 'extra_score'], + 'combine': ['use', 'host', 'pass_key', 'name', 'seed_ratio', 'seed_time', 'extra_score'], }, ], }, diff --git a/couchpotato/core/providers/torrent/torrentpotato/main.py b/couchpotato/core/providers/torrent/torrentpotato/main.py index 501dbd56..a81d0ed4 100644 --- a/couchpotato/core/providers/torrent/torrentpotato/main.py +++ b/couchpotato/core/providers/torrent/torrentpotato/main.py @@ -1,5 +1,5 @@ from couchpotato.core.helpers.encoding import tryUrlencode, toUnicode -from couchpotato.core.helpers.variable import splitString, tryInt +from couchpotato.core.helpers.variable import splitString, tryInt, tryFloat from couchpotato.core.logger import CPLog from couchpotato.core.providers.base import ResultList from couchpotato.core.providers.torrent.base import TorrentProvider @@ -58,6 +58,8 @@ class TorrentPotato(TorrentProvider): 'score': host['extra_score'], 'seeders': torrent.get('seeders'), 'leechers': torrent.get('leechers'), + 'seed_ratio': host['seed_ratio'], + 'seed_time': host['seed_time'], }) except: @@ -95,8 +97,8 @@ class TorrentPotato(TorrentProvider): 'use': uses[nr], 'host': host, 'name': name, - 'seed_ratio': ratio, - 'seed_time': seed_time, + 'seed_ratio': tryFloat(ratio), + 'seed_time': tryInt(seed_time), 'pass_key': key, 'extra_score': tryInt(extra_score[nr]) if len(extra_score) > nr else 0 }) diff --git a/couchpotato/static/style/settings.css b/couchpotato/static/style/settings.css index e47284db..0ee7479a 100644 --- a/couchpotato/static/style/settings.css +++ b/couchpotato/static/style/settings.css @@ -545,28 +545,30 @@ .page .combined_table .head abbr:first-child { display: none; } - .page .combined_table .head abbr.host { - margin-right: 195px; + .page .combined_table .head abbr.host { margin-right: 120px; } + .page .combined_table input.host { width: 140px; } + .page .section_newznab .combined_table .head abbr.host { margin-right: 200px; } + .page .section_newznab .combined_table input.host { width: 220px; } + + .page .combined_table .head abbr.name { margin-right: 57px; } + .page .combined_table input.name { width: 120px; } + .page .combined_table .head abbr.api_key { margin-right: 75px; } + + .page .combined_table .head abbr.pass_key { margin-right: 71px; } + .page .combined_table input.pass_key { width: 113px; } + + .page .section_newznab .combined_table .head abbr.api_key { margin-right: 185px; } + .page .section_newznab .combined_table input.api_key { width: 223px; } + + .page .combined_table .seed_ratio, + .page .combined_table .seed_time { + width: 70px; + text-align: center; + margin-left: 10px; } - .page .combined_table input.host { - width: 215px; - } - .page .combined_table .head abbr.name { - margin-right: 67px; + .page .combined_table .seed_time { + margin-right: 10px; } - .page .combined_table input.name { - width: 120px; - } - .page .combined_table .head abbr.api_key { - margin-right: 178px; - } - .page .combined_table .head abbr.pass_key { - margin-right: 171px; - } - .page .combined_table input.api_key, - .page .combined_table input.pass_key { - width: 213px; - } .page .combined_table .head .extra_score, .page .combined_table .extra_score {