Skip to content

[pull] master from slgobinath:master #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 15, 2025
Merged

Conversation

pull[bot]
Copy link

@pull pull bot commented Feb 15, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

sudoAlphaX and others added 2 commits February 16, 2025 00:05
In come cases where there exists a registered MPRIS player but that
doesn't have support for playerstatus, safeeyes errors and doesnt go
launch a break when the Media Control plugin is enabled.

This patch adds a check too the mediacontrol plugin such that it checks
if "PlaybackStatus" cached_property is not None, and only then attempts
to get media playing status.

Steps to reproduce:

1. Install playerctl
2. Launch playerctld
3. Do not play any media (close all media playing apps)
4. Try to launch a break using safeeyes

Error:

```
  File "/usr/lib/python3.13/site-packages/safeeyes/utility.py", line 106, in <lambda>
    GLib.idle_add(lambda: target_function(*args, **kwargs))
                          ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/safeeyes/core.py", line 277, in __fire_start_break
    self.start_break.fire(break_obj)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/safeeyes/model.py", line 293, in fire
    if not handler(*args, **keywargs):
           ~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/safeeyes/safeeyes.py", line 356, in start_break
    actions = self.plugins_manager.get_break_screen_tray_actions(break_obj)
  File "/usr/lib/python3.13/site-packages/safeeyes/plugin_manager.py", line 209, in get_break_screen_tray_actions
    action = plugin['module'].get_tray_action(break_obj)
  File "/usr/lib/python3.13/site-packages/safeeyes/plugins/mediacontrol/plugin.py", line 89, in get_tray_action
    players = __active_players()
  File "/usr/lib/python3.13/site-packages/safeeyes/plugins/mediacontrol/plugin.py", line 62, in __active_players
    status = player.get_cached_property('PlaybackStatus').unpack().lower()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'unpack'
```

Expected Behaviour:

Doesn't crash
fix: fail safely if unable to get player status (Media Control)
@pull pull bot added the ⤵️ pull label Feb 15, 2025
@pull pull bot merged commit 6a0be4a into Uncodedtech:master Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants