fix(session): save full queue with all tracks and metadata

The save was broken in two ways:
1. Only current_track + upcoming (capped at 20) were saved, dropping
   all history tracks. Queue was reconstructed incomplete on restore.
2. Track metadata (hires, bit_depth, sample_rate, source, etc.) was
   not being persisted, only the basic 6 fields.

Add v2_get_all_queue_tracks command that returns the full uncapped
track list with correct current_index. Use it in saveSessionBeforeClose
instead of the capped v2_get_queue_state. Map all metadata fields.
This commit is contained in:
vicrodh committed 2026-02-20 20:33:39 -06:00
1 parent 5a0d4c50a1
commit aa1aa32f7a
6 files changed
+45 -27

No files matched your search

+9
View File
@@ -4360,6 +4360,15 @@ pub async fn v2_get_queue_state(
Ok(bridge.get_queue_state().await)
}
/// Get all queue tracks and current index (for session persistence, no caps)
#[tauri::command]
pub async fn v2_get_all_queue_tracks(
bridge: State<'_, CoreBridgeState>,
) -> Result<(Vec<CoreQueueTrack>, Option<usize>), RuntimeError> {
let bridge = bridge.get().await;
Ok(bridge.get_all_queue_tracks().await)
}
/// Get currently selected queue track (V2)
#[tauri::command]
pub async fn v2_get_current_queue_track(