Migrate all IPC call sites to typed tauri-specta commands.*
🏗️ Build and Test JellyTau / Run Tests (pull_request) Successful in 4m39s
Traceability Validation / Check Requirement Traces (pull_request) Failing after 36s
🏗️ Build and Test JellyTau / Build Android APK (pull_request) Failing after 1m57s

Replace the remaining ~155 untyped invoke() calls across stores, services,
components, and routes with the generated commands.* wrappers from
$lib/api/bindings, so every IPC call is compile-time-checked against the
command signatures.

- Register repository_get_subtitle_url and repository_get_video_download_url
  in specta_builder() and the invoke_handler; regenerate bindings.ts.
- Source duplicated wire types (AutoplaySettings, CacheConfig, Session,
  ConnectivityStatus, audio/video settings, etc.) from bindings.
- Fix two bugs surfaced by the typed wrappers:
  - VideoDownloadButton passed an un-awaited Promise as the stream URL.
  - setAutoplaySettings omitted the required userId argument.
- Update unit tests asserting the old invoke(name, args) shape.
- Remove the five param-naming guard tests; the compiler and codegen now
  enforce what they checked.

svelte-check: 0 errors. vitest: green. cargo test --lib: green.
This commit is contained in:
2026-06-21 08:47:04 +02:00
parent 14e9d7e03a
commit d01c2aab9f
47 changed files with 456 additions and 2119 deletions
+11 -17
View File
@@ -2,7 +2,7 @@
import { onMount, untrack } from "svelte";
import { page } from "$app/stores";
import { goto } from "$app/navigation";
import { invoke } from "@tauri-apps/api/core";
import { commands } from "$lib/api/bindings";
import type { MediaItem, Library } from "$lib/api/types";
import { library, libraryItems, isLibraryLoading, currentLibrary, libraries } from "$lib/stores/library";
import { auth } from "$lib/stores/auth";
@@ -221,14 +221,11 @@
const repo = auth.getRepository();
const repositoryHandle = repo.getHandle();
const firstTrack = $libraryItems[0];
await invoke("player_play_album_track", {
repositoryHandle,
request: {
albumId: item.id,
albumName: item.name,
trackId: firstTrack.id,
shuffle: false,
},
await commands.playerPlayAlbumTrack(repositoryHandle, {
albumId: item.id,
albumName: item.name,
trackId: firstTrack.id,
shuffle: false,
});
} catch (e) {
console.error("Failed to play album:", e);
@@ -248,14 +245,11 @@
const repositoryHandle = repo.getHandle();
// Pick a random track to start with
const randomTrack = $libraryItems[Math.floor(Math.random() * $libraryItems.length)];
await invoke("player_play_album_track", {
repositoryHandle,
request: {
albumId: item.id,
albumName: item.name,
trackId: randomTrack.id,
shuffle: true,
},
await commands.playerPlayAlbumTrack(repositoryHandle, {
albumId: item.id,
albumName: item.name,
trackId: randomTrack.id,
shuffle: true,
});
} catch (e) {
console.error("Failed to shuffle play album:", e);