Add ratio and seed time styling

This commit is contained in:
Ruud
2013-11-24 21:43:54 +01:00
parent f3380c4fed
commit 8d2e3a1919
3 changed files with 30 additions and 28 deletions
@@ -43,15 +43,13 @@ config = [{
{ {
'name': 'seed_ratio', 'name': 'seed_ratio',
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'default': '1',
'default': 1,
'description': 'Will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': '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.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
@@ -60,7 +58,7 @@ config = [{
'label': 'Pass Key', 'label': 'Pass Key',
'description': 'Can be found on your profile page', 'description': 'Can be found on your profile page',
'type': 'combined', 'type': 'combined',
'combine': ['use', 'host', 'pass_key', 'name', 'extra_score'], 'combine': ['use', 'host', 'pass_key', 'name', 'seed_ratio', 'seed_time', 'extra_score'],
}, },
], ],
}, },
@@ -1,5 +1,5 @@
from couchpotato.core.helpers.encoding import tryUrlencode, toUnicode 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.logger import CPLog
from couchpotato.core.providers.base import ResultList from couchpotato.core.providers.base import ResultList
from couchpotato.core.providers.torrent.base import TorrentProvider from couchpotato.core.providers.torrent.base import TorrentProvider
@@ -58,6 +58,8 @@ class TorrentPotato(TorrentProvider):
'score': host['extra_score'], 'score': host['extra_score'],
'seeders': torrent.get('seeders'), 'seeders': torrent.get('seeders'),
'leechers': torrent.get('leechers'), 'leechers': torrent.get('leechers'),
'seed_ratio': host['seed_ratio'],
'seed_time': host['seed_time'],
}) })
except: except:
@@ -95,8 +97,8 @@ class TorrentPotato(TorrentProvider):
'use': uses[nr], 'use': uses[nr],
'host': host, 'host': host,
'name': name, 'name': name,
'seed_ratio': ratio, 'seed_ratio': tryFloat(ratio),
'seed_time': seed_time, 'seed_time': tryInt(seed_time),
'pass_key': key, 'pass_key': key,
'extra_score': tryInt(extra_score[nr]) if len(extra_score) > nr else 0 'extra_score': tryInt(extra_score[nr]) if len(extra_score) > nr else 0
}) })
+22 -20
View File
@@ -545,28 +545,30 @@
.page .combined_table .head abbr:first-child { .page .combined_table .head abbr:first-child {
display: none; display: none;
} }
.page .combined_table .head abbr.host { .page .combined_table .head abbr.host { margin-right: 120px; }
margin-right: 195px; .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 { .page .combined_table .seed_time {
width: 215px; margin-right: 10px;
}
.page .combined_table .head abbr.name {
margin-right: 67px;
} }
.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 .head .extra_score,
.page .combined_table .extra_score { .page .combined_table .extra_score {