chore(library): delete dead library/commands.rs

The 1,375-line library/commands.rs hosted only unregistered Tauri
commands (54 of them) plus a path-compat pub use of state types.
Every #[tauri::command] in the file is V2-replaced and uncalled.
The state-types pub use was the only external surface and is
already exported canonically from library/mod.rs.

- Delete src-tauri/src/library/commands.rs entirely
- Drop pub mod commands; from library/mod.rs
- Update session_lifecycle.rs to use crate::library::LibraryState
  (the canonical path) instead of crate::library::commands::LibraryState
- Refresh the doc comment in library/state.rs to reflect the
  post-cleanup layout

cc
This commit is contained in:
vicrodh committed 2026-04-26 22:44:34 -06:00
1 parent df1583a727
commit 3b6cb3c51f
4 files changed
+6 -1388

No files matched your search

File diff suppressed because it is too large. Load diff
-1
View File
@@ -4,7 +4,6 @@
//! Commands and remote metadata remain Tauri-specific.
// Tauri-specific modules (stay here)
pub mod commands;
pub mod remote_metadata;
pub mod state;
+3 -9
View File
@@ -1,15 +1,9 @@
//! Shared state and DTO types for the library module.
//!
//! These types were originally defined in `library/commands.rs` alongside
//! their owning Tauri commands. They are relocated here so the type
//! surface remains available after the legacy `#[tauri::command]`
//! definitions in `commands.rs` are eventually removed.
//!
//! Consumers (`commands_v2`, `session_lifecycle`, `cast/commands.rs`,
//! `offline_cache/commands.rs`, etc.) reach these via the existing
//! re-exports in `library/mod.rs`. `commands.rs` itself re-exports the
//! whole module so any historical `crate::library::commands::*` paths
//! continue to compile.
//! their owning Tauri commands. After legacy cleanup the commands module
//! has been deleted and these types live here. Consumers reach them via
//! the re-exports in `library/mod.rs` (`crate::library::LibraryState`).
use serde::Deserialize;
use std::sync::atomic::AtomicBool;
+3 -3
View File
@@ -45,7 +45,7 @@ pub async fn activate_session(app: &tauri::AppHandle, user_id: u64) -> Result<()
app.state::<crate::config::remote_control_settings::AllowedOriginsState>();
// NOTE: legal_settings is GLOBAL - not per-user, not initialized/torn down here
let updates = app.state::<crate::updates::UpdatesState>();
let library = app.state::<crate::library::commands::LibraryState>();
let library = app.state::<crate::library::LibraryState>();
let reco = app.state::<crate::reco_store::RecoState>();
let api_cache = app.state::<crate::api_cache::ApiCacheState>();
let artist_vectors = app.state::<crate::artist_vectors::ArtistVectorStoreState>();
@@ -279,7 +279,7 @@ pub async fn deactivate_session(app: &tauri::AppHandle) -> Result<(), String> {
app.state::<crate::config::remote_control_settings::AllowedOriginsState>();
// NOTE: legal_settings is GLOBAL - not per-user, not initialized/torn down here
let updates = app.state::<crate::updates::UpdatesState>();
let library = app.state::<crate::library::commands::LibraryState>();
let library = app.state::<crate::library::LibraryState>();
let reco = app.state::<crate::reco_store::RecoState>();
let api_cache = app.state::<crate::api_cache::ApiCacheState>();
let artist_vectors = app.state::<crate::artist_vectors::ArtistVectorStoreState>();
@@ -381,7 +381,7 @@ pub async fn activate_offline_session(app: &tauri::AppHandle) -> Result<(), Stri
// Initialize all per-user stores needed for offline operation.
// This mirrors activate_session but skips online-only services
// (MusicBrainz, ListenBrainz, Last.fm, API cache, artist vectors).
let library = app.state::<crate::library::commands::LibraryState>();
let library = app.state::<crate::library::LibraryState>();
let offline = app.state::<crate::offline::OfflineState>();
let offline_cache = app.state::<crate::offline_cache::OfflineCacheState>();
let audio_settings = app.state::<crate::config::audio_settings::AudioSettingsState>();