Add lastPlayedAt to album type
This commit is contained in:
parent
a4584ecd5c
commit
747633fb25
2 changed files with 5 additions and 3 deletions
|
@ -413,14 +413,15 @@ const normalizeAlbum = (item: NDAlbum, server: ServerListItem, imageSize?: numbe
|
||||||
albumArtists: [{ id: item.albumArtistId, name: item.albumArtist }],
|
albumArtists: [{ id: item.albumArtistId, name: item.albumArtist }],
|
||||||
artists: [{ id: item.artistId, name: item.artist }],
|
artists: [{ id: item.artistId, name: item.artist }],
|
||||||
backdropImageUrl: null,
|
backdropImageUrl: null,
|
||||||
createdAt: item.createdAt,
|
createdAt: item.createdAt.split('T')[0],
|
||||||
duration: null,
|
duration: item.duration || null,
|
||||||
genres: item.genres,
|
genres: item.genres,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
imagePlaceholderUrl,
|
imagePlaceholderUrl,
|
||||||
imageUrl,
|
imageUrl,
|
||||||
isCompilation: item.compilation,
|
isCompilation: item.compilation,
|
||||||
isFavorite: item.starred,
|
isFavorite: item.starred,
|
||||||
|
lastPlayedAt: item.playDate ? item.playDate.split('T')[0] : null,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
playCount: item.playCount,
|
playCount: item.playCount,
|
||||||
rating: item.rating,
|
rating: item.rating,
|
||||||
|
@ -456,7 +457,7 @@ const normalizeSong = (
|
||||||
bitRate: item.bitRate,
|
bitRate: item.bitRate,
|
||||||
compilation: item.compilation,
|
compilation: item.compilation,
|
||||||
container: item.suffix,
|
container: item.suffix,
|
||||||
createdAt: item.createdAt,
|
createdAt: item.createdAt.split('T')[0],
|
||||||
discNumber: item.discNumber,
|
discNumber: item.discNumber,
|
||||||
duration: item.duration,
|
duration: item.duration,
|
||||||
genres: item.genres,
|
genres: item.genres,
|
||||||
|
|
|
@ -153,6 +153,7 @@ export type Album = {
|
||||||
imageUrl: string | null;
|
imageUrl: string | null;
|
||||||
isCompilation: boolean | null;
|
isCompilation: boolean | null;
|
||||||
isFavorite: boolean;
|
isFavorite: boolean;
|
||||||
|
lastPlayedAt: string | null;
|
||||||
name: string;
|
name: string;
|
||||||
playCount: number | null;
|
playCount: number | null;
|
||||||
rating: number | null;
|
rating: number | null;
|
||||||
|
|
Reference in a new issue