mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08:00
Merge pull request #12207 from FranciscoPombal/fix-webapi
WebAPI: fix matching uncategorized torrents
This commit is contained in:
commit
ab30cfcdb0
@ -201,7 +201,9 @@ bool RequestParser::parseRequestLine(const QString &line)
|
|||||||
const QByteArray nameComponent = midView(param, 0, eqCharPos);
|
const QByteArray nameComponent = midView(param, 0, eqCharPos);
|
||||||
const QByteArray valueComponent = midView(param, (eqCharPos + 1));
|
const QByteArray valueComponent = midView(param, (eqCharPos + 1));
|
||||||
const QString paramName = QString::fromUtf8(QByteArray::fromPercentEncoding(nameComponent).replace('+', ' '));
|
const QString paramName = QString::fromUtf8(QByteArray::fromPercentEncoding(nameComponent).replace('+', ' '));
|
||||||
const QByteArray paramValue = QByteArray::fromPercentEncoding(valueComponent).replace('+', ' ');
|
const QByteArray paramValue = valueComponent.isNull()
|
||||||
|
? ""
|
||||||
|
: QByteArray::fromPercentEncoding(valueComponent).replace('+', ' ');
|
||||||
|
|
||||||
m_request.query[paramName] = paramValue;
|
m_request.query[paramName] = paramValue;
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,7 @@ void TorrentsController::addAction()
|
|||||||
const TriStateBool addPaused = parseTriStateBool(params()["paused"]);
|
const TriStateBool addPaused = parseTriStateBool(params()["paused"]);
|
||||||
const TriStateBool rootFolder = parseTriStateBool(params()["root_folder"]);
|
const TriStateBool rootFolder = parseTriStateBool(params()["root_folder"]);
|
||||||
const QString savepath = params()["savepath"].trimmed();
|
const QString savepath = params()["savepath"].trimmed();
|
||||||
const QString category = params()["category"].trimmed();
|
const QString category = params()["category"];
|
||||||
const QString cookie = params()["cookie"];
|
const QString cookie = params()["cookie"];
|
||||||
const QString torrentName = params()["rename"].trimmed();
|
const QString torrentName = params()["rename"].trimmed();
|
||||||
const int upLimit = params()["upLimit"].toInt();
|
const int upLimit = params()["upLimit"].toInt();
|
||||||
@ -1025,7 +1025,7 @@ void TorrentsController::setCategoryAction()
|
|||||||
requireParams({"hashes", "category"});
|
requireParams({"hashes", "category"});
|
||||||
|
|
||||||
const QStringList hashes {params()["hashes"].split('|')};
|
const QStringList hashes {params()["hashes"].split('|')};
|
||||||
const QString category {params()["category"].trimmed()};
|
const QString category {params()["category"]};
|
||||||
|
|
||||||
applyToTorrents(hashes, [category](BitTorrent::TorrentHandle *const torrent)
|
applyToTorrents(hashes, [category](BitTorrent::TorrentHandle *const torrent)
|
||||||
{
|
{
|
||||||
@ -1038,7 +1038,7 @@ void TorrentsController::createCategoryAction()
|
|||||||
{
|
{
|
||||||
requireParams({"category"});
|
requireParams({"category"});
|
||||||
|
|
||||||
const QString category {params()["category"].trimmed()};
|
const QString category {params()["category"]};
|
||||||
const QString savePath {params()["savePath"]};
|
const QString savePath {params()["savePath"]};
|
||||||
|
|
||||||
if (category.isEmpty())
|
if (category.isEmpty())
|
||||||
@ -1055,7 +1055,7 @@ void TorrentsController::editCategoryAction()
|
|||||||
{
|
{
|
||||||
requireParams({"category", "savePath"});
|
requireParams({"category", "savePath"});
|
||||||
|
|
||||||
const QString category {params()["category"].trimmed()};
|
const QString category {params()["category"]};
|
||||||
const QString savePath {params()["savePath"]};
|
const QString savePath {params()["savePath"]};
|
||||||
|
|
||||||
if (category.isEmpty())
|
if (category.isEmpty())
|
||||||
|
Loading…
Reference in New Issue
Block a user