mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-06 21:21:24 -07:00
parent
ce013f132f
commit
5c67c5a77d
6 changed files with 52 additions and 4 deletions
|
@ -1437,9 +1437,16 @@ window.qBittorrent.DynamicTable = (function() {
|
|||
}
|
||||
}
|
||||
|
||||
if ((filterTerms !== undefined) && (filterTerms !== null)
|
||||
&& (filterTerms.length > 0) && !window.qBittorrent.Misc.containsAllTerms(name, filterTerms))
|
||||
return false;
|
||||
if ((filterTerms !== undefined) && (filterTerms !== null)) {
|
||||
if (filterTerms instanceof RegExp) {
|
||||
if (!filterTerms.test(name))
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if ((filterTerms.length > 0) && !window.qBittorrent.Misc.containsAllTerms(name, filterTerms))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
@ -1471,8 +1478,11 @@ window.qBittorrent.DynamicTable = (function() {
|
|||
const filteredRows = [];
|
||||
|
||||
const rows = this.rows.getValues();
|
||||
const useRegex = $('torrentsFilterRegexBox').checked;
|
||||
const filterText = $('torrentsFilterInput').value.trim().toLowerCase();
|
||||
const filterTerms = (filterText.length > 0) ? filterText.split(" ") : null;
|
||||
const filterTerms = (filterText.length > 0)
|
||||
? (useRegex ? new RegExp(filterText) : filterText.split(" "))
|
||||
: null;
|
||||
|
||||
for (let i = 0; i < rows.length; ++i) {
|
||||
if (this.applyFilter(rows[i], selected_filter, selected_category, selectedTag, selectedTracker, filterTerms)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue