feat: add playcounts to album and songs

(fix year in song list)
This commit is contained in:
Deluan
2020-03-28 20:38:41 -04:00
parent 777231ea79
commit fec8b5f731
4 changed files with 13 additions and 5 deletions
+6 -2
View File
@@ -10,7 +10,8 @@ import {
SearchInput,
Show,
SimpleShowLayout,
TextField
TextField,
FunctionField
} from 'react-admin'
import { useMediaQuery } from '@material-ui/core'
import {
@@ -93,7 +94,10 @@ const SongList = (props) => {
)}
<TextField source="artist" />
{isDesktop && <NumberField source="trackNumber" />}
{isDesktop && <TextField source="maxYear" />}
{isDesktop && <NumberField source="playCount" />}
{isDesktop && (
<FunctionField source="year" render={(r) => r.year || ''} />
)}
<DurationField source="duration" />
</Datagrid>
)}