From d4447e373fabe7b6c65cf43f39f1d8ad1072419b Mon Sep 17 00:00:00 2001 From: Deluan Date: Wed, 17 Nov 2021 21:47:14 -0500 Subject: [PATCH] Fix sorting albums by year (should use name as secondary sort field). Relates to https://github.com/navidrome/navidrome/issues/961#issuecomment-967624681 --- ui/src/album/AlbumGridView.js | 2 +- ui/src/album/AlbumTableView.js | 4 ++-- ui/src/artist/ArtistShow.js | 2 +- ui/src/common/ArtistLinkField.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/src/album/AlbumGridView.js b/ui/src/album/AlbumGridView.js index cf12b0e45..2ac1db042 100644 --- a/ui/src/album/AlbumGridView.js +++ b/ui/src/album/AlbumGridView.js @@ -164,7 +164,7 @@ const AlbumGridTile = ({ showArtist, record, basePath, ...props }) => { diff --git a/ui/src/album/AlbumTableView.js b/ui/src/album/AlbumTableView.js index a09a0bc69..cc99bddd7 100644 --- a/ui/src/album/AlbumTableView.js +++ b/ui/src/album/AlbumTableView.js @@ -91,7 +91,7 @@ const AlbumTableView = ({ ), year: ( - + ), duration: isDesktop && , rating: config.enableStarRating && ( @@ -132,7 +132,7 @@ const AlbumTableView = ({ )} tertiaryText={(r) => ( <> - +       )} diff --git a/ui/src/artist/ArtistShow.js b/ui/src/artist/ArtistShow.js index 35c01089a..071708050 100644 --- a/ui/src/artist/ArtistShow.js +++ b/ui/src/artist/ArtistShow.js @@ -62,7 +62,7 @@ const AlbumShowLayout = (props) => { addLabel={false} reference="album" target="artist_id" - sort={{ field: 'maxYear', order: 'ASC' }} + sort={{ field: 'max_year', order: 'ASC' }} filter={{ artist_id: record?.id }} perPage={0} pagination={null} diff --git a/ui/src/common/ArtistLinkField.js b/ui/src/common/ArtistLinkField.js index 54babf220..26623658a 100644 --- a/ui/src/common/ArtistLinkField.js +++ b/ui/src/common/ArtistLinkField.js @@ -10,7 +10,7 @@ export const useGetHandleArtistClick = (width) => { return (id) => { return config.devShowArtistPage && id !== config.variousArtistsId ? `/artist/${id}/show` - : `/album?filter={"artist_id":"${id}"}&order=ASC&sort=maxYear&displayedFilters={"compilation":true}&perPage=${perPage}` + : `/album?filter={"artist_id":"${id}"}&order=ASC&sort=max_year&displayedFilters={"compilation":true}&perPage=${perPage}` } }