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) {