mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Add Date Added column in Album and Song lists (#2055)
This commit is contained in:
parent
db6e8e45b7
commit
55b0227494
4 changed files with 23 additions and 11 deletions
|
@ -94,14 +94,19 @@ const AlbumList = (props) => {
|
|||
// Workaround to force album columns to appear the first time.
|
||||
// See https://github.com/navidrome/navidrome/pull/923#issuecomment-833004842
|
||||
// TODO: Find a better solution
|
||||
useSetToggleableFields('album', [
|
||||
'artist',
|
||||
'songCount',
|
||||
'playCount',
|
||||
'year',
|
||||
'duration',
|
||||
'rating',
|
||||
])
|
||||
useSetToggleableFields(
|
||||
'album',
|
||||
[
|
||||
'artist',
|
||||
'songCount',
|
||||
'playCount',
|
||||
'year',
|
||||
'duration',
|
||||
'rating',
|
||||
'createdAt',
|
||||
],
|
||||
['createdAt']
|
||||
)
|
||||
|
||||
// If it does not have filter/sort params (usually coming from Menu),
|
||||
// reload with correct filter/sort params
|
||||
|
|
|
@ -3,6 +3,7 @@ import {
|
|||
Datagrid,
|
||||
DatagridBody,
|
||||
DatagridRow,
|
||||
DateField,
|
||||
NumberField,
|
||||
TextField,
|
||||
} from 'react-admin'
|
||||
|
@ -102,12 +103,14 @@ const AlbumTableView = ({
|
|||
className={classes.ratingField}
|
||||
/>
|
||||
),
|
||||
createdAt: isDesktop && <DateField source="createdAt" showTime />,
|
||||
}
|
||||
}, [classes.ratingField, isDesktop])
|
||||
|
||||
const columns = useSelectedFields({
|
||||
resource: 'album',
|
||||
columns: toggleableFields,
|
||||
defaultOff: ['createdAt'],
|
||||
})
|
||||
|
||||
return isXsmall ? (
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
"rating": "Rating",
|
||||
"quality": "Quality",
|
||||
"bpm": "BPM",
|
||||
"playDate": "Last Played"
|
||||
"playDate": "Last Played",
|
||||
"createdAt": "Date added"
|
||||
},
|
||||
"actions": {
|
||||
"addToQueue": "Play Later",
|
||||
|
@ -51,7 +52,8 @@
|
|||
"year": "Year",
|
||||
"updatedAt": "Updated at",
|
||||
"comment": "Comment",
|
||||
"rating": "Rating"
|
||||
"rating": "Rating",
|
||||
"createdAt": "Date added"
|
||||
},
|
||||
"actions": {
|
||||
"playAll": "Play",
|
||||
|
@ -400,4 +402,4 @@
|
|||
"toggle_love": "Add this track to favourites"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -139,6 +139,7 @@ const SongList = (props) => {
|
|||
bpm: isDesktop && <NumberField source="bpm" />,
|
||||
genre: <TextField source="genre" />,
|
||||
comment: <TextField source="comment" />,
|
||||
createdAt: <DateField source="createdAt" showTime />,
|
||||
}
|
||||
}, [isDesktop, classes.ratingField])
|
||||
|
||||
|
@ -152,6 +153,7 @@ const SongList = (props) => {
|
|||
'albumArtist',
|
||||
'genre',
|
||||
'comment',
|
||||
'createdAt',
|
||||
],
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue