|
|
@ -2611,22 +2611,8 @@ LoadTorrentParams SessionImpl::initLoadTorrentParams(const AddTorrentParams &add |
|
|
|
const auto defaultSavePath = suggestedSavePath(loadTorrentParams.category, addTorrentParams.useAutoTMM); |
|
|
|
const auto defaultSavePath = suggestedSavePath(loadTorrentParams.category, addTorrentParams.useAutoTMM); |
|
|
|
const auto defaultDownloadPath = suggestedDownloadPath(loadTorrentParams.category, addTorrentParams.useAutoTMM); |
|
|
|
const auto defaultDownloadPath = suggestedDownloadPath(loadTorrentParams.category, addTorrentParams.useAutoTMM); |
|
|
|
|
|
|
|
|
|
|
|
loadTorrentParams.useAutoTMM = addTorrentParams.useAutoTMM.value_or(!isAutoTMMDisabledByDefault()); |
|
|
|
loadTorrentParams.useAutoTMM = addTorrentParams.useAutoTMM.value_or( |
|
|
|
|
|
|
|
addTorrentParams.savePath.isEmpty() && addTorrentParams.downloadPath.isEmpty() && !isAutoTMMDisabledByDefault()); |
|
|
|
if (!addTorrentParams.useAutoTMM.has_value()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Default TMM settings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!loadTorrentParams.useAutoTMM) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
loadTorrentParams.savePath = defaultSavePath; |
|
|
|
|
|
|
|
if (isDownloadPathEnabled()) |
|
|
|
|
|
|
|
loadTorrentParams.downloadPath = (!defaultDownloadPath.isEmpty() ? defaultDownloadPath : downloadPath()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Overridden TMM settings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!loadTorrentParams.useAutoTMM) |
|
|
|
if (!loadTorrentParams.useAutoTMM) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -2635,14 +2621,9 @@ LoadTorrentParams SessionImpl::initLoadTorrentParams(const AddTorrentParams &add |
|
|
|
else |
|
|
|
else |
|
|
|
loadTorrentParams.savePath = defaultSavePath / addTorrentParams.savePath; |
|
|
|
loadTorrentParams.savePath = defaultSavePath / addTorrentParams.savePath; |
|
|
|
|
|
|
|
|
|
|
|
if (!addTorrentParams.useDownloadPath.has_value()) |
|
|
|
// if useDownloadPath isn't specified but downloadPath is explicitly set we prefer to use it
|
|
|
|
{ |
|
|
|
const bool useDownloadPath = addTorrentParams.useDownloadPath.value_or(!addTorrentParams.downloadPath.isEmpty() || isDownloadPathEnabled()); |
|
|
|
// Default "Download path" settings
|
|
|
|
if (useDownloadPath) |
|
|
|
|
|
|
|
|
|
|
|
if (isDownloadPathEnabled()) |
|
|
|
|
|
|
|
loadTorrentParams.downloadPath = (!defaultDownloadPath.isEmpty() ? defaultDownloadPath : downloadPath()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (addTorrentParams.useDownloadPath.value()) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
// Overridden "Download path" settings
|
|
|
|
// Overridden "Download path" settings
|
|
|
|
|
|
|
|
|
|
|
@ -2657,7 +2638,6 @@ LoadTorrentParams SessionImpl::initLoadTorrentParams(const AddTorrentParams &add |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (const QString &tag : addTorrentParams.tags) |
|
|
|
for (const QString &tag : addTorrentParams.tags) |
|
|
|
{ |
|
|
|
{ |
|
|
|