-
Notifications
You must be signed in to change notification settings - Fork 453
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
DBus PropertiesChanged event not fired #457
Comments
I've tried implementing this a bit but I'm over my head with rust. Normally the signal is sent by the library automatically on property modification from dbus. In this case since the change is internal it has to be manually sent. Ideally the signal would be raised for the metadata, playback status and position properties. |
Would you mind trying out if the version over at https://github.com/Spotifyd/spotifyd/tree/fix_propertieschanged_event ? This might work but I can't really try it because I don't have access to a linux env right now @justin-gerhardt It should specifically only fix the metadata problem. |
Setting emits_changed alone only raises the signal if the property change was caused by a dbus message setting the metadata property (which can't happen, it's read only). dbus-rs has no way of knowing that fetching the underlying metadata would result in a new result. You will have to somehow feed metadata change events into the dbus server and then run something along the lines of
every time the metadata changes |
DO NOT emit a property changed signal for position. That would result in a crazy amount of signals. The spec clearly says not to. "The org.freedesktop.DBus.Properties.PropertiesChanged signal is not emitted when this property changes." https://specifications.freedesktop.org/mpris-spec/2.2/Player_Interface.html#Property:Position |
My advice on properties are this:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I don't think that this issue has been solved. |
I have a fix for this coming, but it depends on #977 which is about to get merged. |
#977 apparently needs a second review before I can merge it :( |
Also @MDeiml, don't know how far along your fix is, but this branch (master...capnfabs:main) has a working implementation of MPRIS with change notifications in case you want to borrow things from it! It, however, also relies on underlying changes to librespot so that it doesn't have to make requests to the Spotify API; I got approval for that from the librespot team here (librespot-org/librespot#834) and then life got in the way and I never did anything about it 😅 Just in case any of that is helpful :) |
@capnfabs Oh, my fix is only a few lines, I mostly just leverage the player event channel. It still uses the web API so it's probably a bit slower and less reliable than what you tried to achieve. Unrelated to that I also looked at if we could reduce usage of the web API by instead getting info from librespot since that seems to be the cause of some delays like in #891, but I ran into the same problems as you did. librespot does not expose all the data that the web API does. |
Description
Metadata changes do not raise the
org.freedesktop.DBus.Properties.PropertiesChanged
eventCompilation flags
Versions (please complete the following information):
See #455
The text was updated successfully, but these errors were encountered: