Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #7140 from fernandog/patch-1
Browse files Browse the repository at this point in the history
Fix Transmission not reading correct status
  • Loading branch information
RuudBurger committed Nov 27, 2017
2 parents e1f9aa8 + c73a37b commit fda688f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions couchpotato/core/downloaders/transmission.py
Expand Up @@ -143,12 +143,21 @@ 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'] == 0 and torrent['percentDone'] == 1 and torrent['isFinished']:
status = 'completed'
elif torrent['status'] in [5, 6]:
status = 'seeding'
Expand Down

0 comments on commit fda688f

Please sign in to comment.