fix(web-player): follow the API types where they are nullable
The checked-in schema was stale and typed artist, description and externalId as always present, so the code trusted values the API returns as null. The regenerated schema tells the truth; the API-shaped types now admit null and it is normalised on the way into the player, where the state stays non-null.
This commit is contained in:
@@ -34,9 +34,9 @@ export interface QueueItem {
|
||||
export interface ApiTrackLike {
|
||||
id: string | number;
|
||||
title: string;
|
||||
artist?: string;
|
||||
artist?: string | null;
|
||||
source?: 'Local' | 'YouTube';
|
||||
externalId?: string;
|
||||
externalId?: string | null;
|
||||
audioStatus?: 'Pending' | 'Processing' | 'Completed' | 'Failed';
|
||||
isExplicit?: boolean;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ export function toQueueItems(tracks: ApiTrackLike[]): QueueItem[] {
|
||||
return {
|
||||
id: queueIdForTrack(track),
|
||||
title: track.title,
|
||||
artist: track.artist,
|
||||
artist: track.artist ?? undefined,
|
||||
source: youTube ? 'youtube' : 'local',
|
||||
coverUrl: youTube
|
||||
? isPendingYouTubeTrack(track) && track.externalId
|
||||
|
||||
Reference in New Issue
Block a user