From a489397f84b6183af49a510b9f77e1368140d457 Mon Sep 17 00:00:00 2001 From: Mathias Rasmussen Date: Mon, 11 Jul 2016 02:42:56 +0200 Subject: [PATCH] remove torrent data (single file / folder) --- renderer/controllers/torrent-list-controller.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/renderer/controllers/torrent-list-controller.js b/renderer/controllers/torrent-list-controller.js index a229e861..ffa18591 100644 --- a/renderer/controllers/torrent-list-controller.js +++ b/renderer/controllers/torrent-list-controller.js @@ -243,14 +243,10 @@ function deleteFile (path) { }) } -// Delete all files in a torren +// Delete all files in a torrent function moveItemToTrash (torrentSummary) { - // TODO: delete directories, not just files - torrentSummary.files.forEach(function (file) { - var filePath = path.join(torrentSummary.path, file.path) - console.log('DEBUG DELETING ' + filePath) - ipcRenderer.send('moveItemToTrash', filePath) - }) + var filePath = path.join(torrentSummary.path, torrentSummary.files[0].path.split('/')[0]) + ipcRenderer.send('moveItemToTrash', filePath) } function showItemInFolder (torrentSummary) {