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 Vladimir Golovnev (Glassez)
parent a14b50e48c
commit 54dffa1051
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
2 changed files with 6 additions and 0 deletions

View file

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

View file

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