feat(mixtape): Tauri command layer for CRUD
Twelve v2_* commands wrap mixtape::repo with the standard app state pattern used by commands_v2/playlists.rs. Enum values travel as strings across the Tauri boundary; camelCase for frontend, snake_case for Rust. Also adds LibraryDatabase::with_connection_mut for the reorder command, which needs a transaction (&mut Connection). cc
This commit is contained in:
4 files changed
+351
No files matched your search
@@ -754,6 +754,17 @@ impl LibraryDatabase {
|
||||
f(&self.conn)
|
||||
}
|
||||
|
||||
/// Provide mutable raw connection access for operations that require a
|
||||
/// transaction (e.g. reorder operations that delete + reinsert rows).
|
||||
///
|
||||
/// Use sparingly — prefer adding methods to LibraryDatabase directly.
|
||||
pub fn with_connection_mut<F, R>(&mut self, f: F) -> R
|
||||
where
|
||||
F: FnOnce(&mut Connection) -> R,
|
||||
{
|
||||
f(&mut self.conn)
|
||||
}
|
||||
|
||||
// === Folder Management ===
|
||||
|
||||
/// Add a folder to the library with optional network info
|
||||
|
||||
Reference in new issue
Block a user