diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index f9be079f..c80fc267 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -419,7 +419,7 @@ def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list, myDB.action('UPDATE snatched SET status = "Processed" WHERE Status NOT LIKE "Seed%" and AlbumID=?', [albumid]) # Check if torrent has finished seeding - if headphones.TORRENT_DOWNLOADER == (1 or 2): + if headphones.TORRENT_DOWNLOADER == 1 or headphones.TORRENT_DOWNLOADER == 2: seed_snatched = myDB.action('SELECT * from snatched WHERE Status="Seed_Snatched" and AlbumID=?', [albumid]).fetchone() if seed_snatched: hash = seed_snatched['FolderName'] diff --git a/headphones/utorrent.py b/headphones/utorrent.py index 1c1e9bb1..0856df33 100644 --- a/headphones/utorrent.py +++ b/headphones/utorrent.py @@ -162,14 +162,14 @@ def labelTorrent(hash): if label: uTorrentClient.setprops(hash,'label',label) -def removeTorrent(hash): +def removeTorrent(hash, remove_data = False): uTorrentClient = utorrentclient() status, torrentList = uTorrentClient.list() torrents = torrentList['torrents'] for torrent in torrents: if torrent[0].lower() == hash and torrent[21] == 'Finished': logger.info('%s has finished seeding, removing torrent and data' % torrent[2]) - uTorrentClient.remove(hash, True) + uTorrentClient.remove(hash, remove_data) return True return False