mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-06 21:21:24 -07:00
WebUI: Improve filter lists
This PR adds following improvements: * Remove unused tracker entries while processing sync data * Take into account filter selection & terms when performing 'Start/stop/delete' context actions in filter lists Now, only filtered torrents will be affected by them, just like in the GUI. * Provide better feedback when performing 'Start/stop/delete' context actions in filter lists Small improvement over GUI - now these actions will be disabled if it's not possible to use them. * Add context menu to status filter list * Fix error when toggling filter title Fixup for small bug introduced in https://github.com/qbittorrent/qBittorrent/pull/21269 PR #21438.
This commit is contained in:
parent
b1fd61af3a
commit
81509dfb65
9 changed files with 259 additions and 345 deletions
|
@ -1525,9 +1525,20 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
|
||||
getFilteredTorrentsHashes: function(filterName, categoryHash, tagHash, trackerHash) {
|
||||
const rowsHashes = [];
|
||||
const useRegex = document.getElementById("torrentsFilterRegexBox").checked;
|
||||
const filterText = document.getElementById("torrentsFilterInput").value.trim().toLowerCase();
|
||||
let filterTerms;
|
||||
try {
|
||||
filterTerms = (filterText.length > 0)
|
||||
? (useRegex ? new RegExp(filterText) : filterText.split(" "))
|
||||
: null;
|
||||
}
|
||||
catch (e) { // SyntaxError: Invalid regex pattern
|
||||
return filteredRows;
|
||||
}
|
||||
|
||||
for (const row of this.rows.values()) {
|
||||
if (this.applyFilter(row, filterName, categoryHash, tagHash, trackerHash, null))
|
||||
if (this.applyFilter(row, filterName, categoryHash, tagHash, trackerHash, filterTerms))
|
||||
rowsHashes.push(row["rowId"]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue