Skip to content

Commit

Permalink
Supported Transmission labels
Browse files Browse the repository at this point in the history
Closes #24.
  • Loading branch information
jerrymakesjelly committed May 26, 2019
1 parent abe5924 commit 3be796f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autoremovetorrents/client/transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def torrents_list(self):
def torrent_properties(self, torrent_hash):
result = self._make_transmission_request('torrent-get',
{'ids': [torrent_hash],
'fields': ['hashString', 'name', 'trackers', 'status', 'totalSize', 'uploadRatio', 'uploadedEver', 'addedDate', 'secondsSeeding', 'error']}
'fields': ['hashString', 'name', 'trackers', 'status', 'totalSize', 'uploadRatio', 'uploadedEver', 'addedDate', 'secondsSeeding', 'error', 'labels']}
)
if len(result['torrents']) == 0: # No such torrent
raise NoSuchClient("No such torrent of hash '%s'." % torrent_hash)
Expand All @@ -80,6 +80,8 @@ def torrent_properties(self, torrent_hash):
torrent_obj = Torrent()
torrent_obj.hash = torrent['hashString']
torrent_obj.name = torrent['name']
if 'labels' in torrent:
torrent_obj.category = torrent['labels']
torrent_obj.tracker = [tracker['announce'] for tracker in torrent['trackers']]
torrent_obj.status = Transmission._judge_status(torrent['status'], torrent['error'])
torrent_obj.size = torrent['totalSize']
Expand Down

0 comments on commit 3be796f

Please sign in to comment.