mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-22 12:49:26 +00:00
utorrent fix up
This commit is contained in:
@@ -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']
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user