mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-06 21:21:24 -07:00
WebUI: Allow to filter torrent list by save path
This PR adds ability to filter torrent list by save path. Everything should work exactly like in GUI. Closes #19393. PR #21175.
This commit is contained in:
parent
ea06eb9fe6
commit
04eb40376e
4 changed files with 15 additions and 6 deletions
|
@ -1357,7 +1357,6 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
|
||||
applyFilter: function(row, filterName, categoryHash, tagHash, trackerHash, filterTerms) {
|
||||
const state = row["full_data"].state;
|
||||
const name = row["full_data"].name.toLowerCase();
|
||||
let inactive = false;
|
||||
|
||||
switch (filterName) {
|
||||
|
@ -1487,12 +1486,14 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
}
|
||||
|
||||
if ((filterTerms !== undefined) && (filterTerms !== null)) {
|
||||
const filterBy = document.getElementById("torrentsFilterSelect").value;
|
||||
const textToSearch = row["full_data"][filterBy].toLowerCase();
|
||||
if (filterTerms instanceof RegExp) {
|
||||
if (!filterTerms.test(name))
|
||||
if (!filterTerms.test(textToSearch))
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if ((filterTerms.length > 0) && !window.qBittorrent.Misc.containsAllTerms(name, filterTerms))
|
||||
if ((filterTerms.length > 0) && !window.qBittorrent.Misc.containsAllTerms(textToSearch, filterTerms))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue