mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Fix cannot remove trackers via WebAPI
The backport commit c3c7f28bad was insufficient.
Closes 22039.
PR #22071.
This commit is contained in:
@@ -880,7 +880,13 @@ void TorrentsController::removeTrackersAction()
|
|||||||
if (!torrent)
|
if (!torrent)
|
||||||
throw APIError(APIErrorType::NotFound);
|
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);
|
torrent->removeTrackers(urls);
|
||||||
|
|
||||||
if (!torrent->isStopped())
|
if (!torrent->isStopped())
|
||||||
|
|||||||
Reference in New Issue
Block a user