From 2b9945e0df69dbdd20882572fad6633941452ef8 Mon Sep 17 00:00:00 2001 From: adam Date: Sun, 31 Aug 2014 14:41:53 +0800 Subject: [PATCH] Add transmission seed for X hours option --- gui/slick/js/configSearch.js | 2 +- sickbeard/clients/transmission.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gui/slick/js/configSearch.js b/gui/slick/js/configSearch.js index cec16e27..f94630c0 100644 --- a/gui/slick/js/configSearch.js +++ b/gui/slick/js/configSearch.js @@ -63,7 +63,7 @@ $(document).ready(function(){ $('#Torrent_username').show(); $('#Torrent_Path').show(); $('#Torrent_Ratio').show(); - $('#Torrent_Seed_Time').hide(); + $('#Torrent_Seed_Time').show(); $('#Torrent_High_Bandwidth').show(); $('#Torrent_Label').hide(); $('#host_desc').html('Transmission Host'); diff --git a/sickbeard/clients/transmission.py b/sickbeard/clients/transmission.py index 100f3d19..af55f9ef 100644 --- a/sickbeard/clients/transmission.py +++ b/sickbeard/clients/transmission.py @@ -104,6 +104,24 @@ class TransmissionAPI(GenericClient): return self.response.json()['result'] == "success" + def _set_torrent_seed_time(self, result): + + if sickbeard.TORRENT_SEED_TIME: + time = 60 * float(sickbeard.TORRENT_SEED_TIME) + arguments = {'ids': [result.hash], + 'seedIdleLimit': time, + 'seedIdleMode': 1 + } + + post_data = json.dumps({'arguments': arguments, + 'method': 'torrent-set', + }) + self._request(method='post', data=post_data) + + return self.response.json()['result'] == "success" + else: + return True + def _set_torrent_priority(self, result): arguments = {'ids': [result.hash]}