8000 Add mood column to Album and Song list views by deluan · Pull Request #3925 · navidrome/navidrome · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add mood column to Album and Song list views #3925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/src/album/AlbumList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ const AlbumList = (props) => {
'songCount',
'playCount',
'year',
'mood',
'duration',
'rating',
'size',
Expand Down
10 changes: 9 additions & 1 deletion ui/src/album/AlbumTableView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
DateField,
NumberField,
TextField,
FunctionField,
} from 'react-admin'
import { useMediaQuery } from '@material-ui/core'
import FavoriteBorderIcon from '@material-ui/icons/FavoriteBorder'
Expand Down Expand Up @@ -107,6 +108,13 @@ const AlbumTableView = ({
year: (
<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" />,
size: isDesktop && <SizeField source="size" />,
rating: config.enableStarRating && (
Expand All @@ -124,7 +132,7 @@ const AlbumTableView = ({
const columns = useSelectedFields({
resource: 'album',
columns: toggleableFields,
defaultOff: ['createdAt'],
defaultOff: ['createdAt', 'size', 'mood'],
})

return isXsmall ? (
Expand Down
8 changes: 8 additions & 0 deletions 8 ui/src/song/SongList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ const SongList = (props) => {
),
bpm: isDesktop && <NumberField source="bpm" />,
genre: <TextField source="genre" />,
mood: isDesktop && (
<FunctionField
source="mood"
render={(r) => r.tags?.mood?.[0] || ''}
sortable={false}
/>
),
comment: <TextField source="comment" />,
path: <PathField source="path" />,
createdAt: <DateField source="createdAt" showTime />,
Expand All @@ -183,6 +190,7 @@ const SongList = (props) => {
'playDate',
'albumArtist',
'genre',
'mood',
'comment',
'path',
'createdAt',
Expand Down
Loading
0