mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-13 10:47:19 +03:00
feat(ui): add mood column to Album and Song list views (#3925)
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
2b84c574ba
commit
73eb0e254b
@ -196,6 +196,7 @@ const AlbumList = (props) => {
|
|||||||
'songCount',
|
'songCount',
|
||||||
'playCount',
|
'playCount',
|
||||||
'year',
|
'year',
|
||||||
|
'mood',
|
||||||
'duration',
|
'duration',
|
||||||
'rating',
|
'rating',
|
||||||
'size',
|
'size',
|
||||||
|
@ -6,6 +6,7 @@ import {
|
|||||||
DateField,
|
DateField,
|
||||||
NumberField,
|
NumberField,
|
||||||
TextField,
|
TextField,
|
||||||
|
FunctionField,
|
||||||
} from 'react-admin'
|
} from 'react-admin'
|
||||||
import { useMediaQuery } from '@material-ui/core'
|
import { useMediaQuery } from '@material-ui/core'
|
||||||
import FavoriteBorderIcon from '@material-ui/icons/FavoriteBorder'
|
import FavoriteBorderIcon from '@material-ui/icons/FavoriteBorder'
|
||||||
@ -107,6 +108,13 @@ const AlbumTableView = ({
|
|||||||
year: (
|
year: (
|
||||||
<RangeField source={'year'} sortBy={'max_year'} sortByOrder={'DESC'} />
|
<RangeField source={'year'} sortBy={'max_year'} sortByOrder={'DESC'} />
|
||||||
),
|
),
|
||||||
|
mood: isDesktop && (
|
||||||
|
<FunctionField
|
||||||
|
source="mood"
|
||||||
|
render={(r) => r.tags?.mood?.[0] || ''}
|
||||||
|
sortable={false}
|
||||||
|
/>
|
||||||
|
),
|
||||||
duration: isDesktop && <DurationField source="duration" />,
|
duration: isDesktop && <DurationField source="duration" />,
|
||||||
size: isDesktop && <SizeField source="size" />,
|
size: isDesktop && <SizeField source="size" />,
|
||||||
rating: config.enableStarRating && (
|
rating: config.enableStarRating && (
|
||||||
@ -124,7 +132,7 @@ const AlbumTableView = ({
|
|||||||
const columns = useSelectedFields({
|
const columns = useSelectedFields({
|
||||||
resource: 'album',
|
resource: 'album',
|
||||||
columns: toggleableFields,
|
columns: toggleableFields,
|
||||||
defaultOff: ['createdAt'],
|
defaultOff: ['createdAt', 'size', 'mood'],
|
||||||
})
|
})
|
||||||
|
|
||||||
return isXsmall ? (
|
return isXsmall ? (
|
||||||
|
@ -168,6 +168,13 @@ const SongList = (props) => {
|
|||||||
),
|
),
|
||||||
bpm: isDesktop && <NumberField source="bpm" />,
|
bpm: isDesktop && <NumberField source="bpm" />,
|
||||||
genre: <TextField source="genre" />,
|
genre: <TextField source="genre" />,
|
||||||
|
mood: isDesktop && (
|
||||||
|
<FunctionField
|
||||||
|
source="mood"
|
||||||
|
render={(r) => r.tags?.mood?.[0] || ''}
|
||||||
|
sortable={false}
|
||||||
|
/>
|
||||||
|
),
|
||||||
comment: <TextField source="comment" />,
|
comment: <TextField source="comment" />,
|
||||||
path: <PathField source="path" />,
|
path: <PathField source="path" />,
|
||||||
createdAt: <DateField source="createdAt" showTime />,
|
createdAt: <DateField source="createdAt" showTime />,
|
||||||
@ -183,6 +190,7 @@ const SongList = (props) => {
|
|||||||
'playDate',
|
'playDate',
|
||||||
'albumArtist',
|
'albumArtist',
|
||||||
'genre',
|
'genre',
|
||||||
|
'mood',
|
||||||
'comment',
|
'comment',
|
||||||
'path',
|
'path',
|
||||||
'createdAt',
|
'createdAt',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user