diff --git a/src/renderer/api/jellyfin.api.ts b/src/renderer/api/jellyfin.api.ts index d9e15959..589e6118 100644 --- a/src/renderer/api/jellyfin.api.ts +++ b/src/renderer/api/jellyfin.api.ts @@ -642,6 +642,7 @@ const normalizeSong = ( bitRate: item.MediaSources && Number(Math.trunc(item.MediaSources[0]?.Bitrate / 1000)), bpm: null, channels: null, + comment: null, compilation: null, container: (item.MediaSources && item.MediaSources[0]?.Container) || null, createdAt: item.DateCreated, @@ -654,7 +655,6 @@ const normalizeSong = ( isFavorite: (item.UserData && item.UserData.IsFavorite) || false, lastPlayedAt: null, name: item.Name, - note: null, path: (item.MediaSources && item.MediaSources[0]?.Path) || null, playCount: (item.UserData && item.UserData.PlayCount) || 0, // releaseDate: (item.ProductionYear && new Date(item.ProductionYear, 0, 1).toISOString()) || null, diff --git a/src/renderer/api/navidrome.api.ts b/src/renderer/api/navidrome.api.ts index 01cab6da..59ecf67b 100644 --- a/src/renderer/api/navidrome.api.ts +++ b/src/renderer/api/navidrome.api.ts @@ -516,6 +516,7 @@ const normalizeSong = ( bitRate: item.bitRate, bpm: item.bpm ? item.bpm : null, channels: item.channels ? item.channels : null, + comment: item.comment ? item.comment : null, compilation: item.compilation, container: item.suffix, createdAt: item.createdAt.split('T')[0], @@ -526,9 +527,8 @@ const normalizeSong = ( imagePlaceholderUrl, imageUrl, isFavorite: item.starred, - lastPlayedAt: item.playDate ? item.playDate : null, + lastPlayedAt: item.playDate.includes('0001-') ? null : item.playDate, name: item.title, - note: item.comment ? item.comment : null, path: item.path, playCount: item.playCount, releaseDate: new Date(item.year, 0, 1).toISOString(), @@ -567,7 +567,7 @@ const normalizeAlbum = (item: NDAlbum, server: ServerListItem, imageSize?: numbe imageUrl, isCompilation: item.compilation, isFavorite: item.starred, - lastPlayedAt: item.playDate ? item.playDate.split('T')[0] : null, + lastPlayedAt: item.playDate.includes('0001-') ? null : item.playDate, name: item.name, playCount: item.playCount, rating: item.rating, @@ -583,16 +583,18 @@ const normalizeAlbum = (item: NDAlbum, server: ServerListItem, imageSize?: numbe }; const normalizeAlbumArtist = (item: NDAlbumArtist): AlbumArtist => { + console.log('item :>> ', item); + return { albumCount: item.albumCount, backgroundImageUrl: null, - biography: item.biography, + biography: item.biography || null, duration: null, genres: item.genres, id: item.id, - imageUrl: item.largeImageUrl, + imageUrl: item.largeImageUrl || null, isFavorite: item.starred, - lastPlayedAt: item.playDate ? item.playDate.split('T')[0] : null, + lastPlayedAt: item.playDate.includes('0001-') ? null : item.playDate, name: item.name, playCount: item.playCount, rating: item.rating, diff --git a/src/renderer/api/navidrome.types.ts b/src/renderer/api/navidrome.types.ts index 79d61295..fbf8f41d 100644 --- a/src/renderer/api/navidrome.types.ts +++ b/src/renderer/api/navidrome.types.ts @@ -113,16 +113,16 @@ export type NDAlbumArtist = { fullText: string; genres: NDGenre[]; id: string; - largeImageUrl: string; + largeImageUrl?: string; mbzArtistId: string; - mediumImageUrl: string; + mediumImageUrl?: string; name: string; orderArtistName: string; playCount: number; playDate: string; rating: number; size: number; - smallImageUrl: string; + smallImageUrl?: string; songCount: number; starred: boolean; starredAt: string; diff --git a/src/renderer/api/types.ts b/src/renderer/api/types.ts index 940f1c77..476f6201 100644 --- a/src/renderer/api/types.ts +++ b/src/renderer/api/types.ts @@ -179,6 +179,7 @@ export type Song = { bitRate: number; bpm: number | null; channels: number | null; + comment: string | null; compilation: boolean | null; container: string | null; createdAt: string; @@ -191,7 +192,6 @@ export type Song = { isFavorite: boolean; lastPlayedAt: string | null; name: string; - note: string | null; path: string | null; playCount: number; releaseDate: string | null;