eonpatapon / mpDris2

MPRIS V2.1 support for mpd
GNU General Public License v3.0
210 stars 46 forks source link

KeyError: 'volume' when MPD status is paused or stopped #114

Closed protesilaos closed 5 years ago

protesilaos commented 5 years ago

Just wanted to report an issue I have stumbled upon lately. Here is the traceback:

Traceback (most recent call last):
  File "/usr/bin/mpDris2", line 1406, in <module>
    mpd_wrapper.run()
  File "/usr/bin/mpDris2", line 290, in run
    if self.my_connect():
  File "/usr/bin/mpDris2", line 365, in my_connect
    self.timer_callback()
  File "/usr/bin/mpDris2", line 453, in timer_callback
    self._update_properties(force=False)
  File "/usr/bin/mpDris2", line 766, in _update_properties
    if old_status['volume'] != new_status['volume']:
KeyError: 'volume'

It happens every time I try to launch mpDris2 either automatically at startup or manually. The above error prevents the program from running. The issue occurs in two scenarios:

  1. when mpd's status at startup is either paused or stopped and mpDris2 is autostarted.
  2. when mpd is stopped and mpDris2 is launched manually.

I have experienced this issue on an up-to-date installation of Debian Buster/Sid. Below are the package version numbers and corresponding software version for the relevant packages:

Given this opportunity, I also wish to thank you for developing this program!

eonpatapon commented 5 years ago

Hello, thanks for your report

This issue is already fixed by dcf02160d396e838efa752de98663985bcdb6410 but no new release has been made since.

I'll try make one soon

protesilaos commented 5 years ago

Thank you for your time and effort!

In the meantime, I just note the way I worked around the issue:

Prior to autostarting mpDris2, I run mpc play && mpc pause to quasi-activate the client/daemon without actually playing any music. Then everything works as expected.