Fixed: Tag details list movies in alphabetical order

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
pull/2/head
Qstick 5 years ago
parent e8e852100c
commit 9bdaea4a1b

@ -9,7 +9,7 @@ function findMatchingItems(ids, items) {
});
}
function createMatchingMovieSelector() {
function createUnorderedMatchingMoviesSelector() {
return createSelector(
(state, { movieIds }) => movieIds,
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() {
return createSelector(
(state, { delayProfileIds }) => delayProfileIds,
@ -51,7 +71,7 @@ function createMatchingNetImportsSelector() {
function createMapStateToProps() {
return createSelector(
createMatchingMovieSelector(),
createMatchingMoviesSelector(),
createMatchingDelayProfilesSelector(),
createMatchingNotificationsSelector(),
createMatchingRestrictionsSelector(),

Loading…
Cancel
Save