mirror of
https://github.com/navidrome/navidrome.git
synced 2025-05-11 07:41:06 +03:00
Use order fields to sort by artist and album
This commit is contained in:
parent
e6f798811d
commit
3b3ad65612
@ -29,10 +29,11 @@ const AlbumListView = ({ hasShow, hasEdit, hasList, ...rest }) => {
|
||||
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('md'))
|
||||
return (
|
||||
<Datagrid expand={<AlbumDetails />} rowClick={'show'} {...rest}>
|
||||
<TextField source="name" />
|
||||
<TextField source="name" sortBy={'orderAlbumName'} />
|
||||
<FunctionField
|
||||
source="artist"
|
||||
render={(r) => (r.albumArtist ? r.albumArtist : r.artist)}
|
||||
sortBy={'orderAlbumArtistName'}
|
||||
/>
|
||||
{isDesktop && <NumberField source="songCount" />}
|
||||
{isDesktop && <NumberField source="playCount" />}
|
||||
|
@ -26,7 +26,7 @@ const ArtistList = (props) => (
|
||||
<List
|
||||
{...props}
|
||||
title={<Title subTitle={'Artists'} />}
|
||||
sort={{ field: 'name', order: 'ASC' }}
|
||||
sort={{ field: 'orderArtistName', order: 'ASC' }}
|
||||
exporter={false}
|
||||
bulkActionButtons={false}
|
||||
filters={<ArtistFilter />}
|
||||
@ -34,7 +34,7 @@ const ArtistList = (props) => (
|
||||
pagination={<Pagination />}
|
||||
>
|
||||
<Datagrid rowClick={artistRowClick}>
|
||||
<TextField source="name" />
|
||||
<TextField source="name" sortBy={'orderArtistName'} />
|
||||
<NumberField source="albumCount" />
|
||||
</Datagrid>
|
||||
</List>
|
||||
|
@ -63,8 +63,10 @@ const SongList = (props) => {
|
||||
rowClick={(id, basePath, record) => dispatch(setTrack(record))}
|
||||
>
|
||||
<TextField source="title" />
|
||||
{isDesktop && <AlbumLinkField source="album" />}
|
||||
<TextField source="artist" />
|
||||
{isDesktop && (
|
||||
<AlbumLinkField source="album" sortBy={'orderAlbumName'} />
|
||||
)}
|
||||
<TextField source="artist" sortBy={'orderArtistName'} />
|
||||
{isDesktop && <NumberField source="trackNumber" />}
|
||||
{isDesktop && <NumberField source="playCount" />}
|
||||
{isDesktop && (
|
||||
|
Loading…
x
Reference in New Issue
Block a user