refactor: derive PartialEq for PlayerStatusData, simplify status_changed()

This commit is contained in:
2026-03-31 23:38:13 +08:00
parent 96a170f719
commit 2507629b4c
2 changed files with 2 additions and 7 deletions

View File

@@ -78,7 +78,7 @@ pub enum PlayerCommand {
ChangeScene(String),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct PlayerStatusData {
pub running: bool,
pub paused: bool,

View File

@@ -356,12 +356,7 @@ fn publish_state_changed(
}
fn status_changed(old: &PlayerStatusData, new: &PlayerStatusData) -> bool {
old.running != new.running
|| old.paused != new.paused
|| old.in_transition != new.in_transition
|| old.current_index != new.current_index
|| old.playlist_length != new.playlist_length
|| old.current_video != new.current_video
old != new
}
fn lock_processor(