From fbc2566f70796a9fe668d224f09ac926fdc34716 Mon Sep 17 00:00:00 2001 From: Qstick Date: Tue, 16 Jul 2019 22:58:01 -0400 Subject: [PATCH] New: Smart Filter Options for Studios in MovieIndex --- frontend/src/Store/Actions/movieIndexActions.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/Store/Actions/movieIndexActions.js b/frontend/src/Store/Actions/movieIndexActions.js index 2d25b06ba..25b49b9f3 100644 --- a/frontend/src/Store/Actions/movieIndexActions.js +++ b/frontend/src/Store/Actions/movieIndexActions.js @@ -187,7 +187,19 @@ export const defaultState = { { name: 'studio', label: 'Studio', - type: filterBuilderTypes.STRING + type: filterBuilderTypes.ARRAY, + optionsSelector: function(items) { + const tagList = items.reduce((acc, movie) => { + acc.push({ + id: movie.studio, + name: movie.studio + }); + + return acc; + }, []); + + return tagList.sort(sortByName); + } }, { name: 'qualityProfileId',