1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-21 23:42:23 +00:00

Fixed: Using all movie genres for collection filters

This commit is contained in:
Bogdan 2024-12-13 19:13:55 +02:00
parent 27dd8e8cd5
commit 62722d45b0

View file

@ -91,12 +91,8 @@ export const defaultState = {
genres: function(item, filterValue, type) {
const predicate = filterTypePredicates[type];
let allGenres = [];
item.movies.forEach((movie) => {
allGenres = allGenres.concat(movie.genres);
});
const genres = Array.from(new Set(allGenres)).slice(0, 3);
const allGenres = item.movies.flatMap(({ genres }) => genres);
const genres = Array.from(new Set(allGenres));
return predicate(genres, filterValue);
},
@ -138,12 +134,8 @@ export const defaultState = {
type: filterBuilderTypes.ARRAY,
optionsSelector: function(items) {
const genreList = items.reduce((acc, collection) => {
let collectionGenres = [];
collection.movies.forEach((movie) => {
collectionGenres = collectionGenres.concat(movie.genres);
});
const genres = Array.from(new Set(collectionGenres)).slice(0, 3);
const collectionGenres = collection.movies.flatMap(({ genres }) => genres);
const genres = Array.from(new Set(collectionGenres));
genres.forEach((genre) => {
acc.push({