Use order fields to sort by artist and album

This commit is contained in:
Deluan
2020-04-24 13:46:55 -04:00
committed by Deluan Quintão
parent e6f798811d
commit 3b3ad65612
3 changed files with 8 additions and 5 deletions
+2 -1
View File
@@ -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" />}