From 4cfccc54ea17810534d20e9c41eff3345bf00ffa Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Sun, 9 Jan 2022 17:00:56 +0300 Subject: [PATCH] Correctly handle Auto TMM in Torrent Files Watcher --- src/base/torrentfileswatcher.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/base/torrentfileswatcher.cpp b/src/base/torrentfileswatcher.cpp index 83d230e87..38347432b 100644 --- a/src/base/torrentfileswatcher.cpp +++ b/src/base/torrentfileswatcher.cpp @@ -511,7 +511,8 @@ void TorrentFilesWatcher::Worker::processFolder(const QString &path, const QStri if (path != watchedFolderPath) { const QString subdirPath = watchedDir.relativeFilePath(path); - if (addTorrentParams.useAutoTMM) + const bool useAutoTMM = addTorrentParams.useAutoTMM.value_or(!BitTorrent::Session::instance()->isAutoTMMDisabledByDefault()); + if (useAutoTMM) { addTorrentParams.category = addTorrentParams.category.isEmpty() ? subdirPath : (addTorrentParams.category + QLatin1Char('/') + subdirPath); @@ -590,7 +591,8 @@ void TorrentFilesWatcher::Worker::processFailedTorrents() if (exactDirPath != dir.path()) { const QString subdirPath = dir.relativeFilePath(exactDirPath); - if (addTorrentParams.useAutoTMM) + const bool useAutoTMM = addTorrentParams.useAutoTMM.value_or(!BitTorrent::Session::instance()->isAutoTMMDisabledByDefault()); + if (useAutoTMM) { addTorrentParams.category = addTorrentParams.category.isEmpty() ? subdirPath : (addTorrentParams.category + QLatin1Char('/') + subdirPath);