mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-17 20:42:25 +03:00
Add 'Year' column to Album and Playlists song list
This commit is contained in:
parent
d2fcab78a5
commit
292cf99f49
@ -6,6 +6,7 @@ import {
|
||||
NumberField,
|
||||
useVersion,
|
||||
useListContext,
|
||||
FunctionField,
|
||||
} from 'react-admin'
|
||||
import clsx from 'clsx'
|
||||
import { useDispatch } from 'react-redux'
|
||||
@ -110,6 +111,13 @@ const AlbumSongs = (props) => {
|
||||
),
|
||||
artist: isDesktop && <TextField source="artist" sortable={false} />,
|
||||
duration: <DurationField source="duration" sortable={false} />,
|
||||
year: isDesktop && (
|
||||
<FunctionField
|
||||
source="year"
|
||||
render={(r) => r.year || ''}
|
||||
sortByOrder={'DESC'}
|
||||
/>
|
||||
),
|
||||
quality: isDesktop && <QualityInfo source="quality" sortable={false} />,
|
||||
bpm: isDesktop && <NumberField source="bpm" sortable={false} />,
|
||||
rating: isDesktop && config.enableStarRating && (
|
||||
@ -127,7 +135,7 @@ const AlbumSongs = (props) => {
|
||||
resource: 'albumSong',
|
||||
columns: toggleableFields,
|
||||
omittedColumns: ['title'],
|
||||
defaultOff: ['bpm'],
|
||||
defaultOff: ['bpm', 'year'],
|
||||
})
|
||||
|
||||
return (
|
||||
|
@ -10,6 +10,7 @@ import {
|
||||
useVersion,
|
||||
useListContext,
|
||||
ListBase,
|
||||
FunctionField,
|
||||
} from 'react-admin'
|
||||
import clsx from 'clsx'
|
||||
import { useDispatch } from 'react-redux'
|
||||
@ -139,6 +140,13 @@ const PlaylistSongs = ({ playlistId, readOnly, actions, ...props }) => {
|
||||
duration: (
|
||||
<DurationField source="duration" className={classes.draggable} />
|
||||
),
|
||||
year: isDesktop && (
|
||||
<FunctionField
|
||||
source="year"
|
||||
render={(r) => r.year || ''}
|
||||
sortByOrder={'DESC'}
|
||||
/>
|
||||
),
|
||||
quality: isDesktop && <QualityInfo source="quality" sortable={false} />,
|
||||
bpm: isDesktop && <NumberField source="bpm" />,
|
||||
}
|
||||
@ -147,7 +155,7 @@ const PlaylistSongs = ({ playlistId, readOnly, actions, ...props }) => {
|
||||
const columns = useSelectedFields({
|
||||
resource: 'playlistTrack',
|
||||
columns: toggleableFields,
|
||||
defaultOff: ['bpm'],
|
||||
defaultOff: ['bpm', 'year'],
|
||||
})
|
||||
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user