mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
WebUI: Implement removing unused categories
This commit is contained in:
parent
50f2437ac3
commit
24584503d9
7 changed files with 36 additions and 16 deletions
|
@ -360,10 +360,26 @@ initializeWindows = function() {
|
|||
removeCategoryFN = function (categoryHash) {
|
||||
var categoryName = category_list[categoryHash].name;
|
||||
new Request({
|
||||
url: 'command/removeCategory',
|
||||
url: 'command/removeCategories',
|
||||
method: 'post',
|
||||
data: {
|
||||
category: categoryName
|
||||
categories: categoryName
|
||||
}
|
||||
}).send();
|
||||
setCategoryFilter(CATEGORIES_ALL);
|
||||
};
|
||||
|
||||
deleteUnusedCategoriesFN = function () {
|
||||
var categories = [];
|
||||
for (var hash in category_list) {
|
||||
if (torrentsTable.getFilteredTorrentsNumber('all', hash) == 0)
|
||||
categories.push(category_list[hash].name);
|
||||
}
|
||||
new Request({
|
||||
url: 'command/removeCategories',
|
||||
method: 'post',
|
||||
data: {
|
||||
categories: categories.join('\n')
|
||||
}
|
||||
}).send();
|
||||
setCategoryFilter(CATEGORIES_ALL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue