From f022ce8f84c85438fd8f5505a037d7d2f8da6d5c Mon Sep 17 00:00:00 2001 From: Chris B Date: Fri, 22 Nov 2024 22:19:19 -1000 Subject: [PATCH] WebAPI: Add `forced` parameter to `torrents/add` Adds the parameter `addForced` to the `/api/v2/torrents/add` API call. Defaults to false if not provided. PR #21864. --- src/webui/api/torrentscontroller.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index a34971da0148..dcf9580b69e8 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -794,6 +794,7 @@ void TorrentsController::addAction() const bool skipChecking = parseBool(params()[u"skip_checking"_s]).value_or(false); const bool seqDownload = parseBool(params()[u"sequentialDownload"_s]).value_or(false); const bool firstLastPiece = parseBool(params()[u"firstLastPiecePrio"_s]).value_or(false); + const bool addForced = parseBool(params()[u"forced"_s]).value_or(false); const std::optional addToQueueTop = parseBool(params()[u"addToTopOfQueue"_s]); const std::optional addStopped = parseBool(params()[u"stopped"_s]); const QString savepath = params()[u"savepath"_s].trimmed(); @@ -831,7 +832,7 @@ void TorrentsController::addAction() .downloadPath = Path(downloadPath), .sequential = seqDownload, .firstLastPiecePriority = firstLastPiece, - .addForced = false, + .addForced = addForced, .addToQueueTop = addToQueueTop, .addStopped = addStopped, .stopCondition = stopCondition,