refactor(ipc): complete tauri-specta typed-IPC cutover, contract guards, and layering cleanup (#1230)

This commit is contained in:
Psychotoxical
2026-07-04 16:00:31 +02:00
committed by GitHub
parent fdbb9deac6
commit 77ab95170d
199 changed files with 3691 additions and 1252 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import { buildStreamUrl } from '@/lib/api/subsonicStreamUrl';
import type { SubsonicSong } from '@/lib/api/subsonicTypes';
import type { TrackPreviewLocation } from '@/store/authStoreTypes';
import { create } from 'zustand';
import { invoke } from '@tauri-apps/api/core';
import { audioPreviewPlay, audioPreviewStop } from '@/lib/api/audio';
import { usePlayerStore } from '@/features/playback/store/playerStore';
import { useAuthStore } from '@/store/authStore';
import { isOrbitPlaybackSyncActive } from '@/store/orbitRuntime';
@@ -136,7 +136,7 @@ export const usePreviewStore = create<PreviewState>((set, get) => ({
});
try {
await invoke('audio_preview_play', {
await audioPreviewPlay({
id: song.id,
url,
startSec,
@@ -156,7 +156,7 @@ export const usePreviewStore = create<PreviewState>((set, get) => ({
stopPreview: async () => {
if (!get().previewingId) return;
try {
await invoke('audio_preview_stop');
await audioPreviewStop();
} catch {
/* engine will emit preview-end anyway; clear locally as fallback */
set({ previewingId: null, previewingTrack: null, elapsed: 0, audioStarted: false });