Browse Source

Correctly handle Auto TMM in Torrent Files Watcher

PR #13690.
adaptive-webui-19844
Vladimir Golovnev 3 years ago committed by GitHub
parent
commit
d39c6bef4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/base/torrentfileswatcher.cpp

6
src/base/torrentfileswatcher.cpp

@ -511,7 +511,8 @@ void TorrentFilesWatcher::Worker::processFolder(const QString &path, const QStri @@ -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() @@ -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);

Loading…
Cancel
Save