Fixed: Peers filtering in Interactive Search results

Closes #4583
This commit is contained in:
Mark McDowall 2021-08-01 11:08:43 -07:00
parent 076c293942
commit dca2cfcecd
1 changed files with 29 additions and 0 deletions

View File

@ -117,6 +117,35 @@ export const defaultState = {
case filterTypes.NOT_EQUAL: case filterTypes.NOT_EQUAL:
return rejectionCount !== value; return rejectionCount !== value;
default:
return false;
}
},
peers: function(item, value, type) {
const seeders = item.seeders || 0;
const leechers = item.leechers || 0;
const peers = seeders + leechers;
switch (type) {
case filterTypes.EQUAL:
return peers === value;
case filterTypes.GREATER_THAN:
return peers > value;
case filterTypes.GREATER_THAN_OR_EQUAL:
return peers >= value;
case filterTypes.LESS_THAN:
return peers < value;
case filterTypes.LESS_THAN_OR_EQUAL:
return peers <= value;
case filterTypes.NOT_EQUAL:
return peers !== value;
default: default:
return false; return false;
} }