Add missing V2 commands and deprecate legacy integration commands
New V2 commands: - v2_lastfm_set_session: Set session key for restored sessions - v2_listenbrainz_queue_listen: Queue listen for offline (uses legacy cache) Deprecated legacy commands (with #[deprecated] markers): - ListenBrainz: get_status, is_enabled, set_enabled, connect, disconnect, now_playing, scrobble, queue_listen - Last.fm: is_authenticated, get_auth_url, authenticate, set_session, disconnect, scrobble, now_playing - MusicBrainz: is_enabled, set_enabled - Audio: reinit_audio_device All deprecated commands point to their V2 replacements in the note. Frontend migration to V2 commands is next.
This commit is contained in:
1 parent
943f886637
commit
53927b5c6f
6 files changed
+84
No files matched your search
@@ -1,4 +1,9 @@
|
||||
//! Last.fm integration commands
|
||||
//!
|
||||
//! **DEPRECATED**: Use V2 commands in `commands_v2.rs` instead.
|
||||
//! These legacy commands will be removed in a future version.
|
||||
|
||||
#![allow(deprecated)]
|
||||
|
||||
use tauri::State;
|
||||
|
||||
@@ -38,6 +43,7 @@ pub async fn lastfm_set_credentials(
|
||||
}
|
||||
|
||||
/// Check if Last.fm is authenticated
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_lastfm_is_authenticated instead")]
|
||||
#[tauri::command]
|
||||
pub async fn lastfm_is_authenticated(state: State<'_, AppState>) -> Result<bool, String> {
|
||||
let client = state.lastfm.lock().await;
|
||||
@@ -45,6 +51,7 @@ pub async fn lastfm_is_authenticated(state: State<'_, AppState>) -> Result<bool,
|
||||
}
|
||||
|
||||
/// Get Last.fm authentication token and URL
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_lastfm_get_auth_url instead")]
|
||||
#[tauri::command]
|
||||
pub async fn lastfm_get_auth_url(state: State<'_, AppState>) -> Result<(String, String), String> {
|
||||
log::info!("Command: lastfm_get_auth_url");
|
||||
@@ -55,6 +62,7 @@ pub async fn lastfm_get_auth_url(state: State<'_, AppState>) -> Result<(String,
|
||||
}
|
||||
|
||||
/// Complete Last.fm authentication with token
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_lastfm_complete_auth instead")]
|
||||
#[tauri::command]
|
||||
pub async fn lastfm_authenticate(
|
||||
token: String,
|
||||
@@ -66,6 +74,7 @@ pub async fn lastfm_authenticate(
|
||||
}
|
||||
|
||||
/// Set Last.fm session key (for restoring saved session)
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_lastfm_set_session instead")]
|
||||
#[tauri::command]
|
||||
pub async fn lastfm_set_session(
|
||||
session_key: String,
|
||||
@@ -78,6 +87,7 @@ pub async fn lastfm_set_session(
|
||||
}
|
||||
|
||||
/// Disconnect from Last.fm
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_lastfm_disconnect instead")]
|
||||
#[tauri::command]
|
||||
pub async fn lastfm_disconnect(state: State<'_, AppState>) -> Result<(), String> {
|
||||
log::info!("Command: lastfm_disconnect");
|
||||
@@ -88,6 +98,7 @@ pub async fn lastfm_disconnect(state: State<'_, AppState>) -> Result<(), String>
|
||||
}
|
||||
|
||||
/// Scrobble a track to Last.fm
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_lastfm_scrobble instead")]
|
||||
#[tauri::command]
|
||||
pub async fn lastfm_scrobble(
|
||||
artist: String,
|
||||
@@ -104,6 +115,7 @@ pub async fn lastfm_scrobble(
|
||||
}
|
||||
|
||||
/// Update "now playing" on Last.fm
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_lastfm_now_playing instead")]
|
||||
#[tauri::command]
|
||||
pub async fn lastfm_now_playing(
|
||||
artist: String,
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
//! ListenBrainz Tauri commands
|
||||
//!
|
||||
//! Exposes ListenBrainz scrobbling to the frontend
|
||||
//!
|
||||
//! **DEPRECATED**: Use V2 commands in `commands_v2.rs` instead.
|
||||
//! These legacy commands will be removed in a future version.
|
||||
|
||||
#![allow(deprecated)]
|
||||
|
||||
use tauri::State;
|
||||
|
||||
@@ -9,6 +14,7 @@ use crate::listenbrainz::{
|
||||
};
|
||||
|
||||
/// Get ListenBrainz connection status
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_listenbrainz_get_status instead")]
|
||||
#[tauri::command]
|
||||
pub async fn listenbrainz_get_status(
|
||||
state: State<'_, ListenBrainzSharedState>,
|
||||
@@ -18,6 +24,7 @@ pub async fn listenbrainz_get_status(
|
||||
}
|
||||
|
||||
/// Check if ListenBrainz is enabled
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_listenbrainz_is_enabled instead")]
|
||||
#[tauri::command]
|
||||
pub async fn listenbrainz_is_enabled(
|
||||
state: State<'_, ListenBrainzSharedState>,
|
||||
@@ -27,6 +34,7 @@ pub async fn listenbrainz_is_enabled(
|
||||
}
|
||||
|
||||
/// Enable or disable ListenBrainz integration
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_listenbrainz_set_enabled instead")]
|
||||
#[tauri::command]
|
||||
pub async fn listenbrainz_set_enabled(
|
||||
enabled: bool,
|
||||
@@ -53,6 +61,7 @@ pub async fn listenbrainz_set_enabled(
|
||||
}
|
||||
|
||||
/// Connect to ListenBrainz with a user token
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_listenbrainz_connect instead")]
|
||||
#[tauri::command]
|
||||
pub async fn listenbrainz_connect(
|
||||
token: String,
|
||||
@@ -77,6 +86,7 @@ pub async fn listenbrainz_connect(
|
||||
}
|
||||
|
||||
/// Disconnect from ListenBrainz
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_listenbrainz_disconnect instead")]
|
||||
#[tauri::command]
|
||||
pub async fn listenbrainz_disconnect(
|
||||
state: State<'_, ListenBrainzSharedState>,
|
||||
@@ -100,6 +110,7 @@ pub async fn listenbrainz_disconnect(
|
||||
}
|
||||
|
||||
/// Submit "now playing" to ListenBrainz
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_listenbrainz_now_playing instead")]
|
||||
#[tauri::command]
|
||||
pub async fn listenbrainz_now_playing(
|
||||
artist: String,
|
||||
@@ -130,6 +141,7 @@ pub async fn listenbrainz_now_playing(
|
||||
}
|
||||
|
||||
/// Submit a scrobble to ListenBrainz
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_listenbrainz_scrobble instead")]
|
||||
#[tauri::command]
|
||||
pub async fn listenbrainz_scrobble(
|
||||
artist: String,
|
||||
@@ -161,6 +173,7 @@ pub async fn listenbrainz_scrobble(
|
||||
}
|
||||
|
||||
/// Queue a listen for offline submission
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_listenbrainz_queue_listen instead")]
|
||||
#[tauri::command]
|
||||
pub async fn listenbrainz_queue_listen(
|
||||
artist: String,
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
//! MusicBrainz Tauri commands
|
||||
//!
|
||||
//! Exposes MusicBrainz entity resolution to the frontend
|
||||
//!
|
||||
//! **DEPRECATED**: Use V2 commands in `commands_v2.rs` instead.
|
||||
//! These legacy commands will be removed in a future version.
|
||||
|
||||
#![allow(deprecated)]
|
||||
|
||||
use tauri::State;
|
||||
|
||||
@@ -270,6 +275,7 @@ pub async fn musicbrainz_get_artist_relationships(
|
||||
}
|
||||
|
||||
/// Check if MusicBrainz integration is enabled
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_musicbrainz_is_enabled instead")]
|
||||
#[tauri::command]
|
||||
pub async fn musicbrainz_is_enabled(
|
||||
state: State<'_, MusicBrainzSharedState>,
|
||||
@@ -278,6 +284,7 @@ pub async fn musicbrainz_is_enabled(
|
||||
}
|
||||
|
||||
/// Enable or disable MusicBrainz integration
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_musicbrainz_set_enabled instead")]
|
||||
#[tauri::command]
|
||||
pub async fn musicbrainz_set_enabled(
|
||||
enabled: bool,
|
||||
|
||||
@@ -1208,6 +1208,7 @@ pub fn get_audio_output_status(
|
||||
|
||||
/// Reinitialize audio device (releases and re-acquires)
|
||||
/// Call this when changing audio settings like exclusive mode or output device
|
||||
#[deprecated(since = "1.2.0", note = "Use v2_reinit_audio_device instead")]
|
||||
#[tauri::command]
|
||||
pub fn reinit_audio_device(
|
||||
device: Option<String>,
|
||||
|
||||
Reference in new issue
Block a user