Browse Source

Allow to request torrents count via WebAPI

PR #19831.
Closes #19731.
adaptive-webui-private-19844
Vladimir Golovnev 1 year ago committed by GitHub
parent
commit
cecbb44a03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/webui/api/torrentscontroller.cpp
  2. 1
      src/webui/api/torrentscontroller.h
  3. 2
      src/webui/webapplication.h

5
src/webui/api/torrentscontroller.cpp

@ -234,6 +234,11 @@ namespace @@ -234,6 +234,11 @@ namespace
}
}
void TorrentsController::countAction()
{
setResult(QString::number(BitTorrent::Session::instance()->torrents().count()));
}
// Returns all the torrents in JSON format.
// The return value is a JSON-formatted list of dictionaries.
// The dictionary keys are:

1
src/webui/api/torrentscontroller.h

@ -39,6 +39,7 @@ public: @@ -39,6 +39,7 @@ public:
using APIController::APIController;
private slots:
void countAction();
void infoAction();
void propertiesAction();
void trackersAction();

2
src/webui/webapplication.h

@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
#include "base/utils/version.h"
#include "api/isessionmanager.h"
inline const Utils::Version<3, 2> API_VERSION {2, 9, 6};
inline const Utils::Version<3, 2> API_VERSION {2, 10, 0};
class APIController;
class AuthController;

Loading…
Cancel
Save