Fix sorting albums by year (should use name as secondary sort field).

Relates to https://github.com/navidrome/navidrome/issues/961#issuecomment-967624681
This commit is contained in:
Deluan
2021-11-17 21:47:14 -05:00
parent 3bd6f82c80
commit d4447e373f
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ const AlbumGridTile = ({ showArtist, record, basePath, ...props }) => {
<RangeField <RangeField
record={record} record={record}
source={'year'} source={'year'}
sortBy={'maxYear'} sortBy={'max_year'}
sortByOrder={'DESC'} sortByOrder={'DESC'}
className={classes.albumSubtitle} className={classes.albumSubtitle}
/> />
+2 -2
View File
@@ -91,7 +91,7 @@ const AlbumTableView = ({
<NumberField source="playCount" sortByOrder={'DESC'} /> <NumberField source="playCount" sortByOrder={'DESC'} />
), ),
year: ( year: (
<RangeField source={'year'} sortBy={'maxYear'} sortByOrder={'DESC'} /> <RangeField source={'year'} sortBy={'max_year'} sortByOrder={'DESC'} />
), ),
duration: isDesktop && <DurationField source="duration" />, duration: isDesktop && <DurationField source="duration" />,
rating: config.enableStarRating && ( rating: config.enableStarRating && (
@@ -132,7 +132,7 @@ const AlbumTableView = ({
)} )}
tertiaryText={(r) => ( tertiaryText={(r) => (
<> <>
<RangeField record={r} source={'year'} sortBy={'maxYear'} /> <RangeField record={r} source={'year'} sortBy={'max_year'} />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</> </>
)} )}
+1 -1
View File
@@ -62,7 +62,7 @@ const AlbumShowLayout = (props) => {
addLabel={false} addLabel={false}
reference="album" reference="album"
target="artist_id" target="artist_id"
sort={{ field: 'maxYear', order: 'ASC' }} sort={{ field: 'max_year', order: 'ASC' }}
filter={{ artist_id: record?.id }} filter={{ artist_id: record?.id }}
perPage={0} perPage={0}
pagination={null} pagination={null}
+1 -1
View File
@@ -10,7 +10,7 @@ export const useGetHandleArtistClick = (width) => {
return (id) => { return (id) => {
return config.devShowArtistPage && id !== config.variousArtistsId return config.devShowArtistPage && id !== config.variousArtistsId
? `/artist/${id}/show` ? `/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}`
} }
} }