Skip to content

Commit

Permalink
src/mpris2: fix PlaybackStatus sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
eNV25 committed Sep 29, 2023
1 parent e8b6fc5 commit b599b8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mpris2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,11 @@ pub fn playback_status_from(
eof_reached: Option<bool>,
pause: Option<bool>,
) -> fdo::Result<&'static str> {
let (idle_active, eof_reached) = (idle_active.ok_or(()), eof_reached.ok_or(()));
let idle_active = idle_active.ok_or(());
if idle_active.or_else(|_| get!(ctx, "idle-active", bool))?
|| eof_reached.or_else(|_| get!(ctx, "eof-reached", bool))?
|| eof_reached
.or_else(|| get!(ctx, "eof-reached", bool).ok())
.unwrap_or(false)
{
Ok("Stopped")
} else if pause.ok_or(()).or_else(|_| get!(ctx, "pause", bool))? {
Expand Down

0 comments on commit b599b8e

Please sign in to comment.