From 0d3c0c407780f99191c2e010c2fd750f2494e7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20K=C3=A5berg?= Date: Sat, 9 Nov 2013 22:42:09 +0100 Subject: [PATCH] use delete_files --- couchpotato/core/downloaders/rtorrent/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/downloaders/rtorrent/main.py b/couchpotato/core/downloaders/rtorrent/main.py index a631919..ed08114 100755 --- a/couchpotato/core/downloaders/rtorrent/main.py +++ b/couchpotato/core/downloaders/rtorrent/main.py @@ -210,8 +210,9 @@ class rTorrent(Downloader): if torrent is None: return False - for file_item in torrent.get_files(): - os.unlink(os.path.join(torrent.directory, file_item.path)) + if delete_files: + for file_item in torrent.get_files(): # will only delete files, not dir/sub-dir + os.unlink(os.path.join(torrent.directory, file_item.path)) torrent.erase() # just removes the torrent, doesn't delete data