refactor: derive PartialEq for PlayerStatusData, simplify status_changed()
This commit is contained in:
@@ -78,7 +78,7 @@ pub enum PlayerCommand {
|
|||||||
ChangeScene(String),
|
ChangeScene(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct PlayerStatusData {
|
pub struct PlayerStatusData {
|
||||||
pub running: bool,
|
pub running: bool,
|
||||||
pub paused: bool,
|
pub paused: bool,
|
||||||
|
|||||||
@@ -356,12 +356,7 @@ fn publish_state_changed(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn status_changed(old: &PlayerStatusData, new: &PlayerStatusData) -> bool {
|
fn status_changed(old: &PlayerStatusData, new: &PlayerStatusData) -> bool {
|
||||||
old.running != new.running
|
old != new
|
||||||
|| 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lock_processor(
|
fn lock_processor(
|
||||||
|
|||||||
Reference in New Issue
Block a user