mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Fixed: Track Progress custom filtering on artist index page
This commit is contained in:
parent
936b2502cc
commit
60df3d78b4
1 changed files with 22 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
import { createAction } from 'redux-actions';
|
||||
import sortByName from 'Utilities/Array/sortByName';
|
||||
import { filterBuilderTypes, filterBuilderValueTypes, sortDirections } from 'Helpers/Props';
|
||||
import { filterBuilderTypes, filterBuilderValueTypes, filterTypePredicates, sortDirections } from 'Helpers/Props';
|
||||
import createSetTableOptionReducer from './Creators/Reducers/createSetTableOptionReducer';
|
||||
import createSetClientSideCollectionSortReducer from './Creators/Reducers/createSetClientSideCollectionSortReducer';
|
||||
import createSetClientSideCollectionFilterReducer from './Creators/Reducers/createSetClientSideCollectionFilterReducer';
|
||||
|
@ -223,7 +223,27 @@ export const defaultState = {
|
|||
selectedFilterKey: 'all',
|
||||
|
||||
filters,
|
||||
filterPredicates,
|
||||
|
||||
filterPredicates: {
|
||||
...filterPredicates,
|
||||
|
||||
trackProgress: function(item, filterValue, type) {
|
||||
const { statistics = {} } = item;
|
||||
|
||||
const {
|
||||
trackCount = 0,
|
||||
trackFileCount
|
||||
} = statistics;
|
||||
|
||||
const progress = trackCount ?
|
||||
trackFileCount / trackCount * 100 :
|
||||
100;
|
||||
|
||||
const predicate = filterTypePredicates[type];
|
||||
|
||||
return predicate(progress, filterValue);
|
||||
}
|
||||
},
|
||||
|
||||
filterBuilderProps: [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue