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:
2026-07-20 20:20:34 +02:00
parent 68ec3a2aae
commit 9cd916c098
12 changed files with 505 additions and 24 deletions
+3 -3
View File
@@ -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