fix: add missing CSS import and fix UI issues
- Add app.css import to +layout.svelte (fixes broken/light UI) - Add logging for audio debugging - Add image fallbacks for album and track artwork - Fix sidebar/main-content layout (flex-shrink, min-width) - Remove placeholder data from HomeView - Add LoginView and SearchView components - Update window title and branding to QBZ
This commit is contained in:
1 parent
cdfd3263de
commit
3a0e3f26d5
22 files changed
+1950
-298
No files matched your search
@@ -0,0 +1,62 @@
|
||||
//! Playback-related Tauri commands
|
||||
|
||||
use tauri::State;
|
||||
|
||||
use crate::api::models::Quality;
|
||||
use crate::player::PlaybackState;
|
||||
use crate::AppState;
|
||||
|
||||
/// Play a track by ID
|
||||
#[tauri::command]
|
||||
pub async fn play_track(track_id: u64, state: State<'_, AppState>) -> Result<(), String> {
|
||||
log::info!("Command: play_track {}", track_id);
|
||||
|
||||
let client = state.client.lock().await;
|
||||
|
||||
// Default to Hi-Res quality, will fallback if not available
|
||||
state
|
||||
.player
|
||||
.play_track(&client, track_id, Quality::HiRes)
|
||||
.await
|
||||
}
|
||||
|
||||
/// Pause playback
|
||||
#[tauri::command]
|
||||
pub fn pause_playback(state: State<'_, AppState>) -> Result<(), String> {
|
||||
log::info!("Command: pause_playback");
|
||||
state.player.pause()
|
||||
}
|
||||
|
||||
/// Resume playback
|
||||
#[tauri::command]
|
||||
pub fn resume_playback(state: State<'_, AppState>) -> Result<(), String> {
|
||||
log::info!("Command: resume_playback");
|
||||
state.player.resume()
|
||||
}
|
||||
|
||||
/// Stop playback
|
||||
#[tauri::command]
|
||||
pub fn stop_playback(state: State<'_, AppState>) -> Result<(), String> {
|
||||
log::info!("Command: stop_playback");
|
||||
state.player.stop()
|
||||
}
|
||||
|
||||
/// Set volume (0.0 - 1.0)
|
||||
#[tauri::command]
|
||||
pub fn set_volume(volume: f32, state: State<'_, AppState>) -> Result<(), String> {
|
||||
log::info!("Command: set_volume {}", volume);
|
||||
state.player.set_volume(volume)
|
||||
}
|
||||
|
||||
/// Seek to position in seconds
|
||||
#[tauri::command]
|
||||
pub fn seek(position: u64, state: State<'_, AppState>) -> Result<(), String> {
|
||||
log::info!("Command: seek {}", position);
|
||||
state.player.seek(position)
|
||||
}
|
||||
|
||||
/// Get current playback state
|
||||
#[tauri::command]
|
||||
pub fn get_playback_state(state: State<'_, AppState>) -> Result<PlaybackState, String> {
|
||||
state.player.get_state()
|
||||
}
|
||||
Reference in new issue
Block a user