From f3380c4fed0b73da6bca71f5705e21dc69aa1f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20K=C3=A5berg?= Date: Sun, 24 Nov 2013 19:33:29 +0100 Subject: [PATCH] seed_time and seed_ratio --- .../providers/torrent/torrentpotato/__init__.py | 14 ++++++++++++++ .../core/providers/torrent/torrentpotato/main.py | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/couchpotato/core/providers/torrent/torrentpotato/__init__.py b/couchpotato/core/providers/torrent/torrentpotato/__init__.py index 2e4b4662..fab6d178 100644 --- a/couchpotato/core/providers/torrent/torrentpotato/__init__.py +++ b/couchpotato/core/providers/torrent/torrentpotato/__init__.py @@ -40,6 +40,20 @@ config = [{ 'label': 'Username', 'default': '', }, + { + 'name': 'seed_ratio', + 'label': 'Seed ratio', + 'type': 'float', + 'default': 1, + 'description': 'Will not be (re)moved until this seed ratio is met.', + }, + { + 'name': 'seed_time', + 'label': 'Seed time', + 'type': 'int', + 'default': 40, + 'description': 'Will not be (re)moved until this seed time (in hours) is met.', + }, { 'name': 'pass_key', 'default': ',', diff --git a/couchpotato/core/providers/torrent/torrentpotato/main.py b/couchpotato/core/providers/torrent/torrentpotato/main.py index 70320954..501dbd56 100644 --- a/couchpotato/core/providers/torrent/torrentpotato/main.py +++ b/couchpotato/core/providers/torrent/torrentpotato/main.py @@ -68,6 +68,8 @@ class TorrentPotato(TorrentProvider): uses = splitString(str(self.conf('use')), clean = False) hosts = splitString(self.conf('host'), clean = False) names = splitString(self.conf('name'), clean = False) + seed_times = splitString(self.conf('seed_time'), clean = False) + seed_ratios = splitString(self.conf('seed_ratio'), clean = False) pass_keys = splitString(self.conf('pass_key'), clean = False) extra_score = splitString(self.conf('extra_score'), clean = False) @@ -83,10 +85,18 @@ class TorrentPotato(TorrentProvider): try: name = names[nr] except: name = '' + try: ratio = seed_ratios + except: ratio = '' + + try: seed_time = seed_times + except: seed_time = '' + list.append({ 'use': uses[nr], 'host': host, 'name': name, + 'seed_ratio': ratio, + 'seed_time': seed_time, 'pass_key': key, 'extra_score': tryInt(extra_score[nr]) if len(extra_score) > nr else 0 })