mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-27 06:54:20 +00:00
Merge pull request #9586 from Piccirello/webui-categories
Add categories WebAPI
This commit is contained in:
commit
3e8f3d61fb
@ -856,3 +856,18 @@ void TorrentsController::removeCategoriesAction()
|
||||
for (const QString &category : categories)
|
||||
BitTorrent::Session::instance()->removeCategory(category);
|
||||
}
|
||||
|
||||
void TorrentsController::categoriesAction()
|
||||
{
|
||||
QJsonObject categories;
|
||||
const auto categoriesList = BitTorrent::Session::instance()->categories();
|
||||
for (auto it = categoriesList.cbegin(); it != categoriesList.cend(); ++it) {
|
||||
const auto &key = it.key();
|
||||
categories[key] = QJsonObject {
|
||||
{"name", key},
|
||||
{"savePath", it.value()}
|
||||
};
|
||||
}
|
||||
|
||||
setResult(categories);
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ private slots:
|
||||
void createCategoryAction();
|
||||
void editCategoryAction();
|
||||
void removeCategoriesAction();
|
||||
void categoriesAction();
|
||||
void addAction();
|
||||
void deleteAction();
|
||||
void addTrackersAction();
|
||||
|
Loading…
x
Reference in New Issue
Block a user