Layout and search fix
🏗️ Build and Test JellyTau / Run Tests (push) Failing after 2m4s
🏗️ Build and Test JellyTau / Android Compile Check (push) Has been skipped
Traceability Validation / Check Requirement Traces (push) Successful in 23s
Build & Release / Run Tests (push) Failing after 2m45s
Build & Release / Build Linux (push) Has been skipped
Build & Release / Build Android (push) Has been skipped
Build & Release / Create Release (push) Has been skipped
🏗️ Build and Test JellyTau / Run Tests (push) Failing after 2m4s
🏗️ Build and Test JellyTau / Android Compile Check (push) Has been skipped
Traceability Validation / Check Requirement Traces (push) Successful in 23s
Build & Release / Run Tests (push) Failing after 2m45s
Build & Release / Build Linux (push) Has been skipped
Build & Release / Build Android (push) Has been skipped
Build & Release / Create Release (push) Has been skipped
This commit is contained in:
@@ -696,6 +696,11 @@ pub async fn player_stop(
|
||||
let controller = player.0.lock().await;
|
||||
controller.stop().map_err(|e| e.to_string())?;
|
||||
|
||||
// A genuine local stop returns the manager to Idle so it no longer
|
||||
// reports Local (or a stale Remote) — otherwise a later play/pause would
|
||||
// route to the wrong device.
|
||||
playback_mode.0.set_mode(crate::playback_mode::PlaybackMode::Idle);
|
||||
|
||||
// Handle session state based on type (local playback only)
|
||||
{
|
||||
let mut session_mgr = session.0.lock().map_err(|e| e.to_string())?;
|
||||
@@ -1538,6 +1543,9 @@ pub async fn player_play_album_track(
|
||||
play_selection_on_remote(&controller, session_id, &media_items, start_index).await?;
|
||||
controller.set_queue(media_items, start_index).map_err(|e| e.to_string())?;
|
||||
} else {
|
||||
// Local playback is now authoritative (see player_play_tracks); set it
|
||||
// before starting so the mode-changed event precedes the state events.
|
||||
playback_mode.0.set_mode(crate::playback_mode::PlaybackMode::Local);
|
||||
controller
|
||||
.play_queue(media_items, start_index)
|
||||
.map_err(|e| e.to_string())?;
|
||||
@@ -1714,6 +1722,16 @@ pub async fn player_play_tracks(
|
||||
.set_queue(media_items, request.start_index)
|
||||
.map_err(|e| e.to_string())?;
|
||||
} else {
|
||||
// Starting local playback makes Local the authoritative mode. Without
|
||||
// this, a prior Remote mode lingers in the manager and later play/pause
|
||||
// commands route back to the (stopped) remote session. Set it BEFORE
|
||||
// starting playback so the PlaybackModeChanged event reaches the frontend
|
||||
// ahead of the state_changed events it will emit — otherwise the frontend
|
||||
// (still thinking it's remote) filters those state events out. Skip during
|
||||
// a transfer: transfer_to_local drives the mode itself once complete.
|
||||
if !playback_mode.0.is_transferring() {
|
||||
playback_mode.0.set_mode(crate::playback_mode::PlaybackMode::Local);
|
||||
}
|
||||
controller
|
||||
.play_queue_from(media_items, request.start_index, request.start_position)
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
Reference in New Issue
Block a user