Sinono3 / souvlaki

A cross-platform library for handling OS media controls and metadata.
MIT License
79 stars 15 forks source link

PropertiesChanged signal on wrong interface #21

Closed eladyn closed 2 years ago

eladyn commented 2 years ago

As the Metadata as well as the PlaybackStatus properties are both properties on the org.mpris.MediaPlayer2.Player interface, the emitted PropertiesChanged signal should be also for this interface.

Instead, it uses org.mpris.MediaPlayer2:

https://github.com/Sinono3/souvlaki/blob/021369cc9d1e8cae36ad5480af3b53fc0216d7d0/src/platform/linux/mod.rs#L439-L443

See also the output of dbus-monitor:

# dbus-monitor --session "sender=org.mpris.MediaPlayer2.psst,type=signal"    
signal time=1642344094.765597 sender=org.freedesktop.DBus -> destination=:1.255 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.255"
signal time=1642344094.765628 sender=org.freedesktop.DBus -> destination=:1.255 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.255"
signal time=1642344097.536915 sender=:1.202 -> destination=(null destination) serial=50 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2"
   array [
      dict entry(
         string "PlaybackStatus"
         variant             string "Paused"
      )
   ]
   array [
   ]
signal time=1642344098.885224 sender=:1.202 -> destination=(null destination) serial=52 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2"
   array [
      dict entry(
         string "PlaybackStatus"
         variant             string "Playing"
      )
   ]
   array [
   ]

Thank you!

Sinono3 commented 2 years ago

Thanks for pointing this out! Just commited a fix in the master branch. Is it working properly now?

eladyn commented 2 years ago

Yeah, it is. Thank you!

image

This is the native GNOME Shell mpris indicator. I don't know why, but it isn't showing the artist; might be a problem on psst's side (I will investigate that further). If necessary, I will create another issue for this.