MCPcopy Create free account
hub / github.com/Moosync/Moosync / export_playlist

Function export_playlist

src-tauri/src/db/mod.rs:37–48  ·  view source on GitHub ↗
(
    app: AppHandle,
    db: State<Database>,
    window_handler: State<WindowHandler>,
    id: String,
)

Source from the content-addressed store, hash-verified

35#[tauri_invoke_proc::parse_tauri_command]
36#[tauri::command(async)]
37pub fn export_playlist(
38 app: AppHandle,
39 db: State<Database>,
40 window_handler: State<WindowHandler>,
41 id: String,
42) -> Result<()> {
43 info!("Exporting playlist");
44 let exported = db.export_playlist(id)?;
45 let selected_file = window_handler.open_save_file(app)?;
46 trace!("Exported playlist");
47 Ok(fs::write(selected_file, exported)?)
48}
49
50generate_command!(insert_songs, Database, Vec<Song>, songs: Vec<Song>);
51generate_command!(remove_songs, Database, (), songs: Vec<String>);

Callers

nothing calls this directly

Calls 2

open_save_fileMethod · 0.80
export_playlistMethod · 0.45

Tested by

no test coverage detected