1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed: Tag details list movies in alphabetical order

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
Qstick 2020-05-19 22:08:29 -04:00
parent e8e852100c
commit 9bdaea4a1b

View File

@ -9,7 +9,7 @@ function findMatchingItems(ids, items) {
}); });
} }
function createMatchingMovieSelector() { function createUnorderedMatchingMoviesSelector() {
return createSelector( return createSelector(
(state, { movieIds }) => movieIds, (state, { movieIds }) => movieIds,
createAllMoviesSelector(), createAllMoviesSelector(),
@ -17,6 +17,26 @@ function createMatchingMovieSelector() {
); );
} }
function createMatchingMoviesSelector() {
return createSelector(
createUnorderedMatchingMoviesSelector(),
(movies) => {
return movies.sort((movieA, movieB) => {
const sortTitleA = movieA.sortTitle;
const sortTitleB = movieB.sortTitle;
if (sortTitleA > sortTitleB) {
return 1;
} else if (sortTitleA < sortTitleB) {
return -1;
}
return 0;
});
}
);
}
function createMatchingDelayProfilesSelector() { function createMatchingDelayProfilesSelector() {
return createSelector( return createSelector(
(state, { delayProfileIds }) => delayProfileIds, (state, { delayProfileIds }) => delayProfileIds,
@ -51,7 +71,7 @@ function createMatchingNetImportsSelector() {
function createMapStateToProps() { function createMapStateToProps() {
return createSelector( return createSelector(
createMatchingMovieSelector(), createMatchingMoviesSelector(),
createMatchingDelayProfilesSelector(), createMatchingDelayProfilesSelector(),
createMatchingNotificationsSelector(), createMatchingNotificationsSelector(),
createMatchingRestrictionsSelector(), createMatchingRestrictionsSelector(),