mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
WebUI: Eliminate unnecessary Status filter list updates
Only update the Status filter list when torrents are removed, added or their state changed. PR #21866.
This commit is contained in:
parent
6ce2869108
commit
7300b9f759
1 changed files with 8 additions and 1 deletions
|
@ -759,6 +759,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
torrentsFilterInputTimer = -1;
|
torrentsFilterInputTimer = -1;
|
||||||
|
|
||||||
let torrentsTableSelectedRows;
|
let torrentsTableSelectedRows;
|
||||||
|
let updateStatuses = false;
|
||||||
let update_categories = false;
|
let update_categories = false;
|
||||||
let updateTags = false;
|
let updateTags = false;
|
||||||
let updateTrackers = false;
|
let updateTrackers = false;
|
||||||
|
@ -766,6 +767,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
const full_update = (response["full_update"] === true);
|
const full_update = (response["full_update"] === true);
|
||||||
if (full_update) {
|
if (full_update) {
|
||||||
torrentsTableSelectedRows = torrentsTable.selectedRowsIds();
|
torrentsTableSelectedRows = torrentsTable.selectedRowsIds();
|
||||||
|
updateStatuses = true;
|
||||||
update_categories = true;
|
update_categories = true;
|
||||||
updateTags = true;
|
updateTags = true;
|
||||||
updateTrackers = true;
|
updateTrackers = true;
|
||||||
|
@ -870,6 +872,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
const state = response["torrents"][key]["state"];
|
const state = response["torrents"][key]["state"];
|
||||||
response["torrents"][key]["status"] = state;
|
response["torrents"][key]["status"] = state;
|
||||||
response["torrents"][key]["_statusOrder"] = statusSortOrder[state];
|
response["torrents"][key]["_statusOrder"] = statusSortOrder[state];
|
||||||
|
updateStatuses = true;
|
||||||
}
|
}
|
||||||
torrentsTable.updateRowData(response["torrents"][key]);
|
torrentsTable.updateRowData(response["torrents"][key]);
|
||||||
if (addTorrentToCategoryList(response["torrents"][key]))
|
if (addTorrentToCategoryList(response["torrents"][key]))
|
||||||
|
@ -888,6 +891,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
updateTags = true; // Always to update All tag
|
updateTags = true; // Always to update All tag
|
||||||
});
|
});
|
||||||
updateTorrents = true;
|
updateTorrents = true;
|
||||||
|
updateStatuses = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't update the table unnecessarily
|
// don't update the table unnecessarily
|
||||||
|
@ -903,7 +907,10 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
}
|
}
|
||||||
processServerState();
|
processServerState();
|
||||||
}
|
}
|
||||||
updateFiltersList();
|
|
||||||
|
if (updateStatuses)
|
||||||
|
updateFiltersList();
|
||||||
|
|
||||||
if (update_categories) {
|
if (update_categories) {
|
||||||
updateCategoryList();
|
updateCategoryList();
|
||||||
window.qBittorrent.TransferList.contextMenu.updateCategoriesSubMenu(category_list);
|
window.qBittorrent.TransferList.contextMenu.updateCategoriesSubMenu(category_list);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue