mirror of
https://github.com/Radarr/Radarr
synced 2025-01-03 05:44:50 +00:00
Sort movies by name in filter builder
This commit is contained in:
parent
f2357e0b60
commit
9a50fcb82a
1 changed files with 4 additions and 6 deletions
|
@ -2,18 +2,16 @@ import React from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import Movie from 'Movie/Movie';
|
import Movie from 'Movie/Movie';
|
||||||
import createAllMoviesSelector from 'Store/Selectors/createAllMoviesSelector';
|
import createAllMoviesSelector from 'Store/Selectors/createAllMoviesSelector';
|
||||||
|
import sortByName from 'Utilities/Array/sortByName';
|
||||||
import FilterBuilderRowValue from './FilterBuilderRowValue';
|
import FilterBuilderRowValue from './FilterBuilderRowValue';
|
||||||
import FilterBuilderRowValueProps from './FilterBuilderRowValueProps';
|
import FilterBuilderRowValueProps from './FilterBuilderRowValueProps';
|
||||||
|
|
||||||
function MovieFilterBuilderRowValue(props: FilterBuilderRowValueProps) {
|
function MovieFilterBuilderRowValue(props: FilterBuilderRowValueProps) {
|
||||||
const allMovies: Movie[] = useSelector(createAllMoviesSelector());
|
const allMovies: Movie[] = useSelector(createAllMoviesSelector());
|
||||||
|
|
||||||
const tagList = allMovies.map((movie) => {
|
const tagList = allMovies
|
||||||
return {
|
.map((movie) => ({ id: movie.id, name: movie.title }))
|
||||||
id: movie.id,
|
.sort(sortByName);
|
||||||
name: movie.title,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
return <FilterBuilderRowValue {...props} tagList={tagList} />;
|
return <FilterBuilderRowValue {...props} tagList={tagList} />;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue