Skip to content

Commit

Permalink
WebAPI: Add forced parameter to torrents/add
Browse files Browse the repository at this point in the history
Adds the parameter `addForced` to the `/api/v2/torrents/add` API call. Defaults to false if not provided.

PR qbittorrent#21864.
  • Loading branch information
ckanoab authored Nov 23, 2024
1 parent 78a5e4f commit f022ce8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/webui/api/torrentscontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> addToQueueTop = parseBool(params()[u"addToTopOfQueue"_s]);
const std::optional<bool> addStopped = parseBool(params()[u"stopped"_s]);
const QString savepath = params()[u"savepath"_s].trimmed();
Expand Down Expand Up @@ -831,7 +832,7 @@ void TorrentsController::addAction()
.downloadPath = Path(downloadPath),
.sequential = seqDownload,
.firstLastPiecePriority = firstLastPiece,
.addForced = false,
.addForced = addForced,
.addToQueueTop = addToQueueTop,
.addStopped = addStopped,
.stopCondition = stopCondition,
Expand Down

0 comments on commit f022ce8

Please sign in to comment.