Skip to content

Commit

Permalink
Merge pull request #678 from sudoAlphaX/master
Browse files Browse the repository at this point in the history
fix: fail safely if unable to get player status (Media Control)
  • Loading branch information
deltragon authored Feb 15, 2025
2 parents 6061843 + 6349949 commit 6a0be4a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions safeeyes/plugins/mediacontrol/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ def __active_players():
cancellable=None,
)

status = player.get_cached_property('PlaybackStatus').unpack().lower()
playbackstatus = player.get_cached_property("PlaybackStatus")

if playbackstatus is not None:
status = playbackstatus.unpack().lower()

if status == "playing":
players.append(player)
else:
logging.warning(f"Failed to get PlaybackStatus for {service}")

if status == "playing":
players.append(player)
return players


Expand Down

0 comments on commit 6a0be4a

Please sign in to comment.