mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-25 17:28:18 +03:00
WebAPI: fix wrong key used for categories
Regression from 1c0f8b4289
.
Closes #15969.
This commit is contained in:
parent
83b34053a1
commit
d7fd576293
3 changed files with 5 additions and 1 deletions
|
@ -503,6 +503,8 @@ void SyncController::maindataAction()
|
||||||
{
|
{
|
||||||
const BitTorrent::CategoryOptions categoryOptions = session->categoryOptions(categoryName);
|
const BitTorrent::CategoryOptions categoryOptions = session->categoryOptions(categoryName);
|
||||||
QJsonObject category = categoryOptions.toJSON();
|
QJsonObject category = categoryOptions.toJSON();
|
||||||
|
// adjust it to be compatible with exisitng WebAPI
|
||||||
|
category[QLatin1String("savePath")] = category.take(QLatin1String("save_path"));
|
||||||
category.insert(QLatin1String("name"), categoryName);
|
category.insert(QLatin1String("name"), categoryName);
|
||||||
categories[categoryName] = category.toVariantMap();
|
categories[categoryName] = category.toVariantMap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1285,6 +1285,8 @@ void TorrentsController::categoriesAction()
|
||||||
{
|
{
|
||||||
const BitTorrent::CategoryOptions categoryOptions = session->categoryOptions(categoryName);
|
const BitTorrent::CategoryOptions categoryOptions = session->categoryOptions(categoryName);
|
||||||
QJsonObject category = categoryOptions.toJSON();
|
QJsonObject category = categoryOptions.toJSON();
|
||||||
|
// adjust it to be compatible with exisitng WebAPI
|
||||||
|
category[QLatin1String("savePath")] = category.take(QLatin1String("save_path"));
|
||||||
category.insert(QLatin1String("name"), categoryName);
|
category.insert(QLatin1String("name"), categoryName);
|
||||||
categories[categoryName] = category;
|
categories[categoryName] = category;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "base/utils/net.h"
|
#include "base/utils/net.h"
|
||||||
#include "base/utils/version.h"
|
#include "base/utils/version.h"
|
||||||
|
|
||||||
inline const Utils::Version<int, 3, 2> API_VERSION {2, 8, 4};
|
inline const Utils::Version<int, 3, 2> API_VERSION {2, 8, 5};
|
||||||
|
|
||||||
class APIController;
|
class APIController;
|
||||||
class WebApplication;
|
class WebApplication;
|
||||||
|
|
Loading…
Reference in a new issue