Allow to request torrents count via WebAPI

PR #19831.
Closes #19731.
This commit is contained in:
Vladimir Golovnev 2023-11-02 11:12:32 +03:00 committed by GitHub
parent 4a20a1660e
commit cecbb44a03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View file

@ -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:

View file

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

View file

@ -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;