Bump protocols. Added proto status
This commit is contained in:
@@ -263,6 +263,7 @@ pub async fn run(
|
|||||||
state.device_playback.self_device_name = device_name.clone();
|
state.device_playback.self_device_name = device_name.clone();
|
||||||
state.device_playback.active_device_id = Some(device_id);
|
state.device_playback.active_device_id = Some(device_id);
|
||||||
state.device_playback.active_device_name = Some(device_name);
|
state.device_playback.active_device_name = Some(device_name);
|
||||||
|
state.device_playback.startup_takeover_pending = true;
|
||||||
}
|
}
|
||||||
let player_events = event_tx.clone();
|
let player_events = event_tx.clone();
|
||||||
let mut runtime = Runtime {
|
let mut runtime = Runtime {
|
||||||
@@ -2811,6 +2812,18 @@ fn handle_device_playback_snapshot(
|
|||||||
if !snapshot.active {
|
if !snapshot.active {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Starting a player is an explicit claim of the active role. Import the
|
||||||
|
// current queue/position from the previously active peer, then announce a
|
||||||
|
// normal handoff so that the old owner becomes a control device. This is
|
||||||
|
// intentionally one-shot: subsequent snapshots use the regular lease and
|
||||||
|
// explicit-transfer rules.
|
||||||
|
if state.device_playback.startup_takeover_pending {
|
||||||
|
state.device_playback.startup_takeover_pending = false;
|
||||||
|
become_control_device(state, runtime, snapshot);
|
||||||
|
transfer_active_to_this_device(state, runtime);
|
||||||
|
state.status_message = Some("playback moved to this newly started player".to_string());
|
||||||
|
return;
|
||||||
|
}
|
||||||
if local_active_lease_protected(state, now) {
|
if local_active_lease_protected(state, now) {
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
remote = %snapshot.device_id,
|
remote = %snapshot.device_id,
|
||||||
|
|||||||
@@ -1240,6 +1240,9 @@ pub struct DevicePlaybackState {
|
|||||||
pub remote: BTreeMap<String, crate::devices::PlaybackSnapshot>,
|
pub remote: BTreeMap<String, crate::devices::PlaybackSnapshot>,
|
||||||
pub last_remote_snapshot: Option<crate::devices::PlaybackSnapshot>,
|
pub last_remote_snapshot: Option<crate::devices::PlaybackSnapshot>,
|
||||||
pub jam_host: bool,
|
pub jam_host: bool,
|
||||||
|
/// A freshly started TUI owns playback by protocol. The first active
|
||||||
|
/// snapshot discovered during startup is imported and handed off here.
|
||||||
|
pub startup_takeover_pending: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DevicePlaybackState {
|
impl DevicePlaybackState {
|
||||||
|
|||||||
Reference in New Issue
Block a user