Merge 3a43d99344
into 6c1cee5f79
This commit is contained in:
commit
e9469d442b
|
@ -402,9 +402,14 @@ export class Torrent extends EventTarget {
|
|||
|
||||
// maybe filter by tracker...
|
||||
if (pass && tracker && tracker.length > 0) {
|
||||
pass = this.getCollatedTrackers().includes(tracker);
|
||||
if ('public' === tracker) {
|
||||
pass = !this.getPrivateFlag();
|
||||
} else if ('private' === tracker) {
|
||||
pass = this.getPrivateFlag();
|
||||
} else {
|
||||
pass = this.getCollatedTrackers().includes(tracker);
|
||||
}
|
||||
}
|
||||
|
||||
return pass;
|
||||
}
|
||||
|
||||
|
|
|
@ -961,9 +961,22 @@ TODO: fix this when notifications get fixed
|
|||
|
||||
// build the new html
|
||||
let string = '';
|
||||
// All trackers option
|
||||
string += this.filterTracker
|
||||
? '<option value="all">All</option>'
|
||||
: '<option value="all" selected="selected">All</option>';
|
||||
|
||||
// Public/private trackers options
|
||||
string +=
|
||||
this.filterTracker === 'public'
|
||||
? '<option value="public" selected="selected">Public</option>'
|
||||
: '<option value="public">Public</option>';
|
||||
string +=
|
||||
this.filterTracker === 'private'
|
||||
? '<option value="private" selected="selected">Private</option>'
|
||||
: '<option value="private">Private</option>';
|
||||
string += '<option style="background-color: #000000;" disabled>--</option>';
|
||||
|
||||
for (const sitename of sitenames) {
|
||||
string += `<option value="${sitename}"`;
|
||||
if (sitename === this.filterTracker) {
|
||||
|
@ -972,10 +985,7 @@ TODO: fix this when notifications get fixed
|
|||
string += `>${Transmission._displayName(sitename)}</option>`;
|
||||
}
|
||||
|
||||
if (!this.filterTrackersStr || this.filterTrackersStr !== string) {
|
||||
this.filterTrackersStr = string;
|
||||
document.querySelector('#filter-tracker').innerHTML = string;
|
||||
}
|
||||
document.querySelector('#filter-tracker').innerHTML = string;
|
||||
}
|
||||
|
||||
/// FILTER
|
||||
|
|
Loading…
Reference in New Issue