Fixed: Filter by Peers in Interactive Search

pull/5048/head
Qstick 4 years ago
parent 09ed2ab889
commit 959d63b4eb

@ -1,5 +1,5 @@
import { createAction } from 'redux-actions';
import { filterBuilderTypes, filterBuilderValueTypes, filterTypes, sortDirections } from 'Helpers/Props';
import { filterBuilderTypes, filterBuilderValueTypes, filterTypePredicates, filterTypes, sortDirections } from 'Helpers/Props';
import { createThunk, handleThunks } from 'Store/thunks';
import createAjaxRequest from 'Utilities/createAjaxRequest';
import translate from 'Utilities/String/translate';
@ -83,6 +83,14 @@ export const defaultState = {
return false;
},
peers: function(item, value, type) {
const predicate = filterTypePredicates[type];
const seeders = item.seeders || 0;
const leechers = item.leechers || 0;
return predicate(seeders + leechers, value);
},
rejectionCount: function(item, value, type) {
const rejectionCount = item.rejections.length;

Loading…
Cancel
Save