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:
@@ -73,7 +73,7 @@ function createPlaybackModeStore() {
|
||||
* - Polls remote session until track loads
|
||||
* - Stops local playback
|
||||
*/
|
||||
async function transferToRemote(sessionId: string): Promise<void> {
|
||||
async function transferToRemote(sessionId: string | null | undefined): Promise<void> {
|
||||
console.log("[PlaybackMode] Transferring to remote session:", sessionId);
|
||||
update((s) => ({ ...s, isTransferring: true, transferError: null }));
|
||||
|
||||
@@ -100,11 +100,11 @@ function createPlaybackModeStore() {
|
||||
}
|
||||
|
||||
// Update local state
|
||||
sessions.selectSession(sessionId);
|
||||
sessions.selectSession(sessionId ?? null);
|
||||
update((s) => ({
|
||||
...s,
|
||||
mode: "remote",
|
||||
remoteSessionId: sessionId,
|
||||
remoteSessionId: sessionId ?? null,
|
||||
isTransferring: false,
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user