feat(v2-commands): fix parameter names for frontend compatibility

- Use camelCase parameter names (albumId, trackId, artistId) to match
  frontend expectations
- Add #[allow(non_snake_case)] to suppress warnings

V2 commands are ready for testing. Full frontend migration pending:
- Search commands need searchType parameter
- Need to add get_user_info, login with full flow, etc.
This commit is contained in:
vicrodh committed 2026-02-14 19:48:12 -06:00
1 parent b930fa11ba
commit a8f56444ce
1 file changed
+9 -6
+9 -6
View File
@@ -123,30 +123,33 @@ pub async fn v2_search_artists(
/// Get album by ID (V2 - uses QbzCore) /// Get album by ID (V2 - uses QbzCore)
#[tauri::command] #[tauri::command]
#[allow(non_snake_case)]
pub async fn v2_get_album( pub async fn v2_get_album(
album_id: String, albumId: String,
bridge: State<'_, CoreBridgeState>, bridge: State<'_, CoreBridgeState>,
) -> Result<Album, String> { ) -> Result<Album, String> {
let bridge = bridge.get().await; let bridge = bridge.get().await;
bridge.get_album(&album_id).await bridge.get_album(&albumId).await
} }
/// Get track by ID (V2 - uses QbzCore) /// Get track by ID (V2 - uses QbzCore)
#[tauri::command] #[tauri::command]
#[allow(non_snake_case)]
pub async fn v2_get_track( pub async fn v2_get_track(
track_id: u64, trackId: u64,
bridge: State<'_, CoreBridgeState>, bridge: State<'_, CoreBridgeState>,
) -> Result<Track, String> { ) -> Result<Track, String> {
let bridge = bridge.get().await; let bridge = bridge.get().await;
bridge.get_track(track_id).await bridge.get_track(trackId).await
} }
/// Get artist by ID (V2 - uses QbzCore) /// Get artist by ID (V2 - uses QbzCore)
#[tauri::command] #[tauri::command]
#[allow(non_snake_case)]
pub async fn v2_get_artist( pub async fn v2_get_artist(
artist_id: u64, artistId: u64,
bridge: State<'_, CoreBridgeState>, bridge: State<'_, CoreBridgeState>,
) -> Result<Artist, String> { ) -> Result<Artist, String> {
let bridge = bridge.get().await; let bridge = bridge.get().await;
bridge.get_artist(artist_id).await bridge.get_artist(artistId).await
} }