Skip to content

Commit

Permalink
Fix cannot remove trackers
Browse files Browse the repository at this point in the history
The backport commit c3c7f28 was
insufficient.

Closes 22039.
  • Loading branch information
Chocobo1 committed Dec 26, 2024
1 parent 0188e11 commit 122ba10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/webui/api/torrentscontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,13 @@ void TorrentsController::removeTrackersAction()
if (!torrent)
throw APIError(APIErrorType::NotFound);

const QStringList urls = params()[u"urls"_s].split(u'|');
const QStringList urlsParam = params()[u"urls"_s].split(u'|', Qt::SkipEmptyParts);

QStringList urls;
urls.reserve(urlsParam.size());
for (const QString &urlStr : urlsParam)
urls << QUrl::fromPercentEncoding(urlStr.toLatin1());

torrent->removeTrackers(urls);

if (!torrent->isStopped())
Expand Down

0 comments on commit 122ba10

Please sign in to comment.