From 747633fb25d2984ee7b905af84f3332df3bc0539 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Sat, 24 Dec 2022 13:32:27 -0800 Subject: [PATCH] Add lastPlayedAt to album type --- src/renderer/api/navidrome.api.ts | 7 ++++--- src/renderer/api/types.ts | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/api/navidrome.api.ts b/src/renderer/api/navidrome.api.ts index 57724fe2..d7315456 100644 --- a/src/renderer/api/navidrome.api.ts +++ b/src/renderer/api/navidrome.api.ts @@ -413,14 +413,15 @@ const normalizeAlbum = (item: NDAlbum, server: ServerListItem, imageSize?: numbe albumArtists: [{ id: item.albumArtistId, name: item.albumArtist }], artists: [{ id: item.artistId, name: item.artist }], backdropImageUrl: null, - createdAt: item.createdAt, - duration: null, + createdAt: item.createdAt.split('T')[0], + duration: item.duration || null, genres: item.genres, id: item.id, imagePlaceholderUrl, imageUrl, isCompilation: item.compilation, isFavorite: item.starred, + lastPlayedAt: item.playDate ? item.playDate.split('T')[0] : null, name: item.name, playCount: item.playCount, rating: item.rating, @@ -456,7 +457,7 @@ const normalizeSong = ( bitRate: item.bitRate, compilation: item.compilation, container: item.suffix, - createdAt: item.createdAt, + createdAt: item.createdAt.split('T')[0], discNumber: item.discNumber, duration: item.duration, genres: item.genres, diff --git a/src/renderer/api/types.ts b/src/renderer/api/types.ts index e9e9fd5f..3caee781 100644 --- a/src/renderer/api/types.ts +++ b/src/renderer/api/types.ts @@ -153,6 +153,7 @@ export type Album = { imageUrl: string | null; isCompilation: boolean | null; isFavorite: boolean; + lastPlayedAt: string | null; name: string; playCount: number | null; rating: number | null;