Add transmission seed for X hours option

This commit is contained in:
adam 2014-08-31 14:41:53 +08:00
parent 1f8cf44ea2
commit 2b9945e0df
2 changed files with 19 additions and 1 deletions

View File

@ -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');

View File

@ -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]}