allow headphones to remove torrent. fixes #279

This commit is contained in:
clinton-hall 2014-03-12 10:37:15 +10:30
commit fc451f054d
2 changed files with 5 additions and 7 deletions

View file

@ -314,6 +314,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
except: except:
Logger.exception("MAIN: Failed to move file: %s", file) Logger.exception("MAIN: Failed to move file: %s", file)
continue continue
shutil.rmtree(outputDestination)
# Hardlink solution for uTorrent, need to implent support for deluge, transmission # Hardlink solution for uTorrent, need to implent support for deluge, transmission
if clientAgent in ['utorrent', 'transmission', 'deluge'] and inputHash: if clientAgent in ['utorrent', 'transmission', 'deluge'] and inputHash:
@ -322,12 +323,8 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
Logger.debug("MAIN: Deleting torrent %s from %s", inputName, clientAgent) Logger.debug("MAIN: Deleting torrent %s from %s", inputName, clientAgent)
if clientAgent == 'utorrent' and utorrentClass != "": if clientAgent == 'utorrent' and utorrentClass != "":
utorrentClass.removedata(inputHash) utorrentClass.removedata(inputHash)
if not inputCategory in hpCategory:
utorrentClass.remove(inputHash) utorrentClass.remove(inputHash)
if clientAgent == 'transmission' and TransmissionClass !="": if clientAgent == 'transmission' and TransmissionClass !="":
if inputCategory in hpCategory: #don't delete actual files for hp category, just remove torrent.
TransmissionClass.remove_torrent(inputID, False)
else:
TransmissionClass.remove_torrent(inputID, True) TransmissionClass.remove_torrent(inputID, True)
if clientAgent == 'deluge' and delugeClient != "": if clientAgent == 'deluge' and delugeClient != "":
delugeClient.core.remove_torrent(inputID, True) delugeClient.core.remove_torrent(inputID, True)

View file

@ -2,7 +2,8 @@ Change_LOG / History
V9.3 XX/XX/2014 V9.3 XX/XX/2014
Impacts Torrents
Allow Headphones to remove torrents and data after processing.
V9.2 05/03/2014 V9.2 05/03/2014