refactor: move analysis admin commands into psysonic-analysis (M6/7)

Reframed M6 from "extract psysonic-commands" to "place each domain's
Tauri commands in its own domain crate" — the original psysonic-commands
proposal would have been a thin shell with no clear domain ownership
because each prior milestone already kept its own commands inline:

  audio_*_commands           in psysonic-audio
  cache/sync commands        in psysonic-syncfs
  navidrome/discord/etc      in psysonic-integration

The leftover analysis admin commands (7 of them) logically belong to
the analysis domain. So they move there:

  src/lib_commands/app_api/analysis.rs   →
    crates/psysonic-analysis/src/commands.rs

  WaveformCachePayload + LoudnessCachePayload  moved out of top-crate
                                               lib.rs into commands.rs

PlaybackQueryHandle gets a second closure (`should_defer_backfill`) so
analysis_enqueue_seed_from_url can ask "is a ranged playback already
going to seed this track?" without depending on psysonic-audio.

Top crate keeps the shell-flavored commands (window/tray/mini-player,
greet/exit_app, mpris/global-shortcuts/check_dir_accessible, perf,
cli_bridge) for M7 to clean up.

Behaviour preserving. Cargo check + clippy --workspace clean.
This commit is contained in:
Psychotoxical
2026-05-09 14:00:33 +02:00
parent 98d8ea6353
commit 97f06459f3
5 changed files with 98 additions and 73 deletions
+3 -9
View File
@@ -1,4 +1,3 @@
mod analysis;
mod cli_bridge;
mod core;
mod integration;
@@ -20,12 +19,7 @@ pub(crate) use integration::{
check_dir_accessible, mpris_set_metadata, mpris_set_playback, register_global_shortcut,
unregister_global_shortcut,
};
pub(crate) use analysis::{
analysis_delete_all_waveforms, analysis_delete_loudness_for_track,
analysis_enqueue_seed_from_url, analysis_get_loudness_for_track, analysis_get_waveform,
analysis_get_waveform_for_track, analysis_prune_pending_to_track_ids,
};
// Discord, Navidrome admin, last.fm + radio-browser + CORS proxy, bandsintown
// now live in `psysonic_integration`. invoke_handler! in lib.rs registers
// them with their full paths so Tauri's `__cmd__*` macros resolve correctly.
// Discord, Navidrome admin, last.fm + radio-browser + CORS proxy, bandsintown,
// and analysis admin commands now live in their domain crates. invoke_handler!
// in lib.rs registers them with full paths so Tauri's `__cmd__*` macros resolve.