From 9721acbf630d3c12eb8db56cd989467279b0a730 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 29 Nov 2020 02:41:47 +0200 Subject: [PATCH] Don't try to remove folders for a torrent without metadata --- src/base/bittorrent/session.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 81c61df5d..5f129ab98 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -4704,17 +4704,17 @@ void Session::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_ale if (removingTorrentDataIter == m_removingTorrents.end()) return; - // libtorrent won't delete the directory if it contains files not listed in the torrent, - // so we remove the directory ourselves - Utils::Fs::smartRemoveEmptyFolderTree(removingTorrentDataIter->pathToRemove); - if (p->error) { + // libtorrent won't delete the directory if it contains files not listed in the torrent, + // so we remove the directory ourselves + Utils::Fs::smartRemoveEmptyFolderTree(removingTorrentDataIter->pathToRemove); + LogMsg(tr("'%1' was removed from the transfer list but the files couldn't be deleted. Error: %2", "'xxx.avi' was removed...") .arg(removingTorrentDataIter->name, QString::fromLocal8Bit(p->error.message().c_str())) , Log::WARNING); } - else + else // torrent without metadata, hence no files on disk { LogMsg(tr("'%1' was removed from the transfer list.", "'xxx.avi' was removed...").arg(removingTorrentDataIter->name)); }