Browse Source

WebAPI: fix wrong key used for categories

Regression from 1c0f8b4289.
Closes #15969.
PR #15988.
adaptive-webui-19844
Chocobo1 3 years ago committed by GitHub
parent
commit
d6e0164766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/webui/api/synccontroller.cpp
  2. 2
      src/webui/api/torrentscontroller.cpp
  3. 2
      src/webui/webapplication.h

2
src/webui/api/synccontroller.cpp

@ -503,6 +503,8 @@ void SyncController::maindataAction() @@ -503,6 +503,8 @@ void SyncController::maindataAction()
{
const BitTorrent::CategoryOptions categoryOptions = session->categoryOptions(categoryName);
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);
categories[categoryName] = category.toVariantMap();
}

2
src/webui/api/torrentscontroller.cpp

@ -1280,6 +1280,8 @@ void TorrentsController::categoriesAction() @@ -1280,6 +1280,8 @@ void TorrentsController::categoriesAction()
{
const BitTorrent::CategoryOptions categoryOptions = session->categoryOptions(categoryName);
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);
categories[categoryName] = category;
}

2
src/webui/webapplication.h

@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
#include "base/utils/net.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 WebApplication;

Loading…
Cancel
Save