Browse Source

Merge pull request #13871 from sledgehammer999/magnet_delete

Don't try to remove folders for a torrent without metadata
adaptive-webui-19844
sledgehammer999 4 years ago committed by GitHub
parent
commit
82716d8014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/base/bittorrent/session.cpp

6
src/base/bittorrent/session.cpp

@ -4704,17 +4704,17 @@ void Session::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_ale @@ -4704,17 +4704,17 @@ void Session::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_ale
if (removingTorrentDataIter == m_removingTorrents.end())
return;
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);
if (p->error)
{
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));
}

Loading…
Cancel
Save