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:
vicrodh committed 2026-04-18 18:04:08 -06:00
1 parent c55a208215
commit b539f67b7c
4 files changed
+351

No files matched your search

+11
View File
@@ -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