utorrent fix up

This commit is contained in:
Ade
2014-08-13 18:14:02 +12:00
parent c9debdcce5
commit 6891252cf6
2 changed files with 3 additions and 3 deletions

View File

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

View File

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