|
|
@ -1268,12 +1268,9 @@ const TorrentsTable = new Class({ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (filterTerms) { |
|
|
|
if ((filterTerms !== undefined) && (filterTerms !== null) |
|
|
|
for (let i = 0; i < filterTerms.length; ++i) { |
|
|
|
&& (filterTerms.length > 0) && !containsAllTerms(name, filterTerms)) |
|
|
|
if (name.indexOf(filterTerms[i]) === -1) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -1517,16 +1514,6 @@ const SearchResultsTable = new Class({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getFilteredAndSortedRows: function() { |
|
|
|
getFilteredAndSortedRows: function() { |
|
|
|
const containsAll = function(text, searchTerms) { |
|
|
|
|
|
|
|
text = text.toLowerCase(); |
|
|
|
|
|
|
|
for (let i = 0; i < searchTerms.length; ++i) { |
|
|
|
|
|
|
|
if (text.indexOf(searchTerms[i].toLowerCase()) === -1) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getSizeFilters = function() { |
|
|
|
const getSizeFilters = function() { |
|
|
|
let minSize = (searchSizeFilter.min > 0.00) ? (searchSizeFilter.min * Math.pow(1024, searchSizeFilter.minUnit)) : 0.00; |
|
|
|
let minSize = (searchSizeFilter.min > 0.00) ? (searchSizeFilter.min * Math.pow(1024, searchSizeFilter.minUnit)) : 0.00; |
|
|
|
let maxSize = (searchSizeFilter.max > 0.00) ? (searchSizeFilter.max * Math.pow(1024, searchSizeFilter.maxUnit)) : 0.00; |
|
|
|
let maxSize = (searchSizeFilter.max > 0.00) ? (searchSizeFilter.max * Math.pow(1024, searchSizeFilter.maxUnit)) : 0.00; |
|
|
@ -1571,8 +1558,8 @@ const SearchResultsTable = new Class({ |
|
|
|
for (let i = 0; i < rows.length; ++i) { |
|
|
|
for (let i = 0; i < rows.length; ++i) { |
|
|
|
const row = rows[i]; |
|
|
|
const row = rows[i]; |
|
|
|
|
|
|
|
|
|
|
|
if (searchInTorrentName && !containsAll(row.full_data.fileName, searchTerms)) continue; |
|
|
|
if (searchInTorrentName && !containsAllTerms(row.full_data.fileName, searchTerms)) continue; |
|
|
|
if ((filterTerms.length > 0) && !containsAll(row.full_data.fileName, filterTerms)) continue; |
|
|
|
if ((filterTerms.length > 0) && !containsAllTerms(row.full_data.fileName, filterTerms)) continue; |
|
|
|
if ((sizeFilters.min > 0.00) && (row.full_data.fileSize < sizeFilters.min)) continue; |
|
|
|
if ((sizeFilters.min > 0.00) && (row.full_data.fileSize < sizeFilters.min)) continue; |
|
|
|
if ((sizeFilters.max > 0.00) && (row.full_data.fileSize > sizeFilters.max)) continue; |
|
|
|
if ((sizeFilters.max > 0.00) && (row.full_data.fileSize > sizeFilters.max)) continue; |
|
|
|
if ((seedsFilters.min > 0) && (row.full_data.nbSeeders < seedsFilters.min)) continue; |
|
|
|
if ((seedsFilters.min > 0) && (row.full_data.nbSeeders < seedsFilters.min)) continue; |
|
|
@ -1907,12 +1894,7 @@ const TorrentFilesTable = new Class({ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const lowercaseName = node.name.toLowerCase(); |
|
|
|
if (containsAllTerms(node.name, filterTerms)) { |
|
|
|
const matchesFilter = filterTerms.every(function(term) { |
|
|
|
|
|
|
|
return (lowercaseName.indexOf(term) !== -1); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (matchesFilter) { |
|
|
|
|
|
|
|
const row = this.getRow(node); |
|
|
|
const row = this.getRow(node); |
|
|
|
filteredRows.push(row); |
|
|
|
filteredRows.push(row); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|