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:
@@ -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}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -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'} />
|
||||||
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
@@ -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}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user