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
+14 -19
View File
@@ -1,5 +1,6 @@
<script lang="ts">
import { invoke } from "@tauri-apps/api/core";
import { commands } from "$lib/api/bindings";
import type { PlayTracksContext } from "$lib/api/bindings";
import { goto } from "$app/navigation";
import { queue } from "$lib/stores/queue";
import { auth } from "$lib/stores/auth";
@@ -62,14 +63,11 @@
if (context && context.type === "album") {
const repositoryHandle = repo.getHandle();
console.log(`[TrackList] Playing track: "${track.name}" (ID: ${track.id}, index in list: ${index})`);
await invoke("player_play_album_track", {
repositoryHandle,
request: {
albumId: context.albumId,
albumName: context.albumName,
trackId: track.id,
shuffle: false,
},
await commands.playerPlayAlbumTrack(repositoryHandle, {
albumId: context.albumId,
albumName: context.albumName,
trackId: track.id,
shuffle: false,
});
return;
}
@@ -80,7 +78,7 @@
const trackIds = tracks.map((t) => t.id);
// Determine context for queue
let playContext;
let playContext: PlayTracksContext;
if (context?.type === "playlist") {
playContext = {
type: "playlist",
@@ -88,17 +86,14 @@
playlistName: context.playlistName,
};
} else {
playContext = { type: "custom" };
playContext = { type: "custom", label: null };
}
await invoke("player_play_tracks", {
repositoryHandle,
request: {
trackIds,
startIndex: index,
shuffle: false,
context: playContext,
},
await commands.playerPlayTracks(repositoryHandle, {
trackIds,
startIndex: index,
shuffle: false,
context: playContext,
});
// Queue will auto-update from Rust backend event