Files
Psychotoxical-psysonic/src-tauri/src/lib_commands/mod.rs
T
Psychotoxical 9417d522f3 refactor: extract psysonic-syncfs crate (M4/7)
Moves all on-disk cache + device-sync code out of the top crate:

  crates/psysonic-syncfs/                      new lib crate
    src/cache/{offline,hot,downloads,fs_utils} unchanged behaviour
    src/sync/{batch,device}                    (no tray.rs — that's UI)
    src/file_transfer.rs                       shared HTTP helpers
    src/lib.rs                                 + DownloadSemaphore type
                                               + sync_cancel_flags fn

The shell crate keeps `lib_commands/sync/tray.rs` (OS tray icon — UI
concern, will move to shell-tauri at M7) but drops the rest of
`lib_commands/cache/` and the syncfs sibling files.

Tauri command quirk surfaced and resolved: `#[tauri::command]` puts its
`__cmd__*` and `__tauri_command_name_*` helper macros at the *exact*
module of the function, and `pub use` doesn't carry them across module
boundaries. invoke_handler! in lib.rs now references each syncfs
command via its full deepest path
(`psysonic_syncfs::cache::offline::download_track_offline`, etc.) so
Tauri's macros resolve at the right scope. Same approach the audio
crate already uses (`audio::commands::audio_play`).

Cross-crate ref migrations applied via batch sed:
  crate::audio::*               → psysonic_audio::*
  crate::analysis_runtime::*    → psysonic_analysis::analysis_runtime::*
  crate::analysis_cache::*      → psysonic_analysis::analysis_cache::*
  crate::subsonic_wire_user_agent → psysonic_core::user_agent::*
  super::super::file_transfer:: → crate::file_transfer::

Behaviour preserving. Cargo check + clippy --workspace clean.
2026-05-09 13:45:53 +02:00

17 lines
643 B
Rust

pub(crate) mod app_api;
pub(crate) mod sync;
pub(crate) mod ui;
// Each subdirectory re-exports its Tauri commands explicitly. Flatten one
// more level here so `lib.rs`'s `use lib_commands::*;` lands every
// invoke-handler-registered name at lib.rs scope.
pub(crate) use app_api::*;
pub(crate) use sync::*;
pub(crate) use ui::*;
// Cache + file_transfer + sync commands now live in psysonic_syncfs.
// invoke_handler! in lib.rs registers them with their full paths
// (`psysonic_syncfs::cache::*` / `psysonic_syncfs::sync::*`) so Tauri's
// `__cmd__*` magic macros resolve across the crate boundary. Nothing to
// re-export at this level.