Skip to content

Commit 6a0be4a

Browse files
authored
Merge pull request slgobinath#678 from sudoAlphaX/master
fix: fail safely if unable to get player status (Media Control)
2 parents 6061843 + 6349949 commit 6a0be4a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

safeeyes/plugins/mediacontrol/plugin.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,16 @@ def __active_players():
5959
cancellable=None,
6060
)
6161

62-
status = player.get_cached_property('PlaybackStatus').unpack().lower()
62+
playbackstatus = player.get_cached_property("PlaybackStatus")
63+
64+
if playbackstatus is not None:
65+
status = playbackstatus.unpack().lower()
66+
67+
if status == "playing":
68+
players.append(player)
69+
else:
70+
logging.warning(f"Failed to get PlaybackStatus for {service}")
6371

64-
if status == "playing":
65-
players.append(player)
6672
return players
6773

6874

0 commit comments

Comments
 (0)