Workstream E (backend): wire tauri-specta — annotate commands, derive Type, generate-ready Builder
- Add #[specta::specta] to all 201 #[tauri::command] functions. - Derive specta::Type on all IPC DTOs (repository/types, settings, player/storage/ download command DTOs, player enums, jellyfin SessionInfo/NowPlayingItem/PlayState, ThumbnailCacheStats, DownloadInfo, CacheConfig, etc.). - Replace tauri::generate_handler! with a tauri_specta::Builder + collect_commands! in lib.rs (exports bindings.ts in debug builds). Two contract changes required by specta constraints (frontend migration follows): - specta caps command arity at 10 args: download_item_and_start / download_item / download_video now take a single request struct (params bundled, body unchanged via destructuring). - specta can't parse split serde rename_all: SessionInfo/NowPlayingItem/PlayState switched to rename_all = "PascalCase" (Jellyfin deserialization preserved; these now serialize PascalCase to the frontend). cargo check --lib is clean (0 errors). Frontend migration to bindings.ts is the next step.
This commit is contained in:
@@ -9,6 +9,7 @@ use super::PlayerStateWrapper;
|
||||
|
||||
/// Play items on a remote Jellyfin session (casting)
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn remote_play_on_session(
|
||||
player: State<'_, PlayerStateWrapper>,
|
||||
session_id: String,
|
||||
@@ -36,6 +37,7 @@ pub async fn remote_play_on_session(
|
||||
|
||||
/// Send a playback command to a remote session
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn remote_send_command(
|
||||
player: State<'_, PlayerStateWrapper>,
|
||||
session_id: String,
|
||||
@@ -59,6 +61,7 @@ pub async fn remote_send_command(
|
||||
|
||||
/// Seek on a remote session
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn remote_session_seek(
|
||||
player: State<'_, PlayerStateWrapper>,
|
||||
session_id: String,
|
||||
@@ -82,6 +85,7 @@ pub async fn remote_session_seek(
|
||||
|
||||
/// Set volume on a remote session
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn remote_session_set_volume(
|
||||
player: State<'_, PlayerStateWrapper>,
|
||||
session_id: String,
|
||||
@@ -105,6 +109,7 @@ pub async fn remote_session_set_volume(
|
||||
|
||||
/// Toggle mute on a remote session
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn remote_session_toggle_mute(
|
||||
player: State<'_, PlayerStateWrapper>,
|
||||
session_id: String,
|
||||
|
||||
Reference in New Issue
Block a user