E frontend reconciliation (2/2): align consumers to generated bindings; svelte-check clean
Reconcile the ~50 frontend files that consumed the old hand-written types against
the stricter generated bindings (141 -> 0 svelte-check errors):
- Nullable strictness: null-coalesce/guard at consumer sites; widen shared helpers
(CachedImage.tag, ticksToSeconds, formatDuration, getSessionIcon, session store
send*/transferToRemote) to accept null.
- Field-name fixes exposed by codegen: userData.played -> isPlayed; remote
NowPlayingItem uses album (not albumName); ArtistItem id/name.
- player.ts: normalize remote NowPlayingItem -> MediaItem in mergedMedia.
- ArtistItem now serializes camelCase (PascalCase alias retained for Jellyfin
deserialize); update its serialize test.
- Update downloads.test.ts to the bundled { request } shape; complete the
sessions.test.ts NowPlayingItem mock.
Frontend: svelte-check 0 errors, vitest 448 passing. Backend: 387 passing.
This commit is contained in:
@@ -51,11 +51,11 @@
|
||||
<div class="flex items-center gap-3 mt-3 pt-3 border-t border-white/10">
|
||||
<div class="w-12 h-12 rounded overflow-hidden flex-shrink-0">
|
||||
<CachedImage
|
||||
itemId={nowPlaying.id}
|
||||
itemId={nowPlaying.id ?? ""}
|
||||
imageType="Primary"
|
||||
tag={nowPlaying.primaryImageTag}
|
||||
maxWidth={80}
|
||||
alt={nowPlaying.name}
|
||||
alt={nowPlaying.name ?? undefined}
|
||||
class="w-full h-full object-cover"
|
||||
/>
|
||||
</div>
|
||||
@@ -64,8 +64,8 @@
|
||||
<p class="text-sm font-medium text-white truncate">{nowPlaying.name}</p>
|
||||
{#if nowPlaying.artists && nowPlaying.artists.length > 0}
|
||||
<p class="text-xs text-gray-400 truncate">{nowPlaying.artists.join(", ")}</p>
|
||||
{:else if nowPlaying.albumName}
|
||||
<p class="text-xs text-gray-400 truncate">{nowPlaying.albumName}</p>
|
||||
{:else if nowPlaying.album}
|
||||
<p class="text-xs text-gray-400 truncate">{nowPlaying.album}</p>
|
||||
{/if}
|
||||
|
||||
<div class="flex items-center gap-2 mt-1">
|
||||
|
||||
Reference in New Issue
Block a user