From 91d72802c82710bf9e54e8de93b14272d26153bb Mon Sep 17 00:00:00 2001 From: Fernando Date: Tue, 6 Dec 2016 12:12:13 -0200 Subject: [PATCH 1/2] Fix Transmission not reading correct status --- couchpotato/core/downloaders/transmission.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/downloaders/transmission.py b/couchpotato/core/downloaders/transmission.py index f40b955f2b..41f5c239e6 100644 --- a/couchpotato/core/downloaders/transmission.py +++ b/couchpotato/core/downloaders/transmission.py @@ -143,12 +143,23 @@ def getAllDownloadStatus(self, ids): log.debug('name=%s / id=%s / downloadDir=%s / hashString=%s / percentDone=%s / status=%s / isStalled=%s / eta=%s / uploadRatio=%s / isFinished=%s / incomplete-dir-enabled=%s / incomplete-dir=%s', (torrent['name'], torrent['id'], torrent['downloadDir'], torrent['hashString'], torrent['percentDone'], torrent['status'], torrent.get('isStalled', 'N/A'), torrent['eta'], torrent['uploadRatio'], torrent['isFinished'], session['incomplete-dir-enabled'], session['incomplete-dir'])) + """ + https://trac.transmissionbt.com/browser/branches/2.8x/libtransmission/transmission.h#L1853 + 0 = Torrent is stopped + 1 = Queued to check files + 2 = Checking files + 3 = Queued to download + 4 = Downloading + 5 = Queued to seed + 6 = Seeding + """ + status = 'busy' if torrent.get('isStalled') and not torrent['percentDone'] == 1 and self.conf('stalled_as_failed'): status = 'failed' elif torrent['status'] == 0 and torrent['percentDone'] == 1: status = 'completed' - elif torrent['status'] == 16 and torrent['percentDone'] == 1: + elif torrent['status'] == 6 and torrent['percentDone'] == 1: status = 'completed' elif torrent['status'] in [5, 6]: status = 'seeding' From c73a37b7962a42efc522d125afa2458c86f8b8b3 Mon Sep 17 00:00:00 2001 From: Fernando Date: Fri, 20 Jan 2017 14:51:08 -0300 Subject: [PATCH 2/2] Read param isFinished because otherwise torrent can be paused but seed is not finished --- couchpotato/core/downloaders/transmission.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/couchpotato/core/downloaders/transmission.py b/couchpotato/core/downloaders/transmission.py index 41f5c239e6..4bb7dbecab 100644 --- a/couchpotato/core/downloaders/transmission.py +++ b/couchpotato/core/downloaders/transmission.py @@ -157,9 +157,7 @@ def getAllDownloadStatus(self, ids): status = 'busy' if torrent.get('isStalled') and not torrent['percentDone'] == 1 and self.conf('stalled_as_failed'): status = 'failed' - elif torrent['status'] == 0 and torrent['percentDone'] == 1: - status = 'completed' - elif torrent['status'] == 6 and torrent['percentDone'] == 1: + elif torrent['status'] == 0 and torrent['percentDone'] == 1 and torrent['isFinished']: status = 'completed' elif torrent['status'] in [5, 6]: status = 'seeding'