From 0bba3f342e631d6242551bae141f0a77e9108d73 Mon Sep 17 00:00:00 2001 From: Vladimir Golovnev Date: Sat, 27 Dec 2025 09:04:06 +0300 Subject: [PATCH] Fix incorrect save path when torrent is added from watched folder PR #23656. Closes #23302. --- src/base/torrentfileswatcher.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/base/torrentfileswatcher.cpp b/src/base/torrentfileswatcher.cpp index 5fa224d05..70c1da1fe 100644 --- a/src/base/torrentfileswatcher.cpp +++ b/src/base/torrentfileswatcher.cpp @@ -434,9 +434,9 @@ void TorrentFilesWatcher::Worker::processFolder(const Path &path, const Path &wa } else { - if (!m_failedTorrents.value(path).contains(filePath)) + if (!m_failedTorrents.value(watchedFolderPath).contains(filePath)) { - m_failedTorrents[path][filePath] = 0; + m_failedTorrents[watchedFolderPath][filePath] = 0; } } } @@ -471,7 +471,7 @@ void TorrentFilesWatcher::Worker::processFailedTorrents() BitTorrent::AddTorrentParams addTorrentParams = options.addTorrentParams; if (torrentPath != watchedFolderPath) { - const Path subdirPath = watchedFolderPath.relativePathOf(torrentPath); + const Path subdirPath = watchedFolderPath.relativePathOf(torrentPath).parentPath(); const bool useAutoTMM = addTorrentParams.useAutoTMM.value_or(!BitTorrent::Session::instance()->isAutoTMMDisabledByDefault()); if (useAutoTMM) {