GNOME Bugzilla – Bug 779052
MPRIS TrackList GoTo Method Crashes gnome-music
Last modified: 2017-03-13 21:10:19 UTC
Calling the GoTo method with a valid TrackId crashes gnome-music. Traceback (most recent call last):
+ Trace 237163
result = getattr(self, method_name)(*args)
self.player.playlistField)
Steps to duplicate: Start gnome-music. Start d-feet. Read the Tracks property. Feed one of the TrackId's to the GoTo method. gnome-music dies a horrible flaming death...
This seems to be an oversight with code that was updated in 2015(!), I guess no-one tests/uses this particular aspect of mpris much and so far it has gone undetected. This particular issue should be an easy fix afaics. It should just add an argument for discovery. Which I guess should be status pending. Patch is welcome.
I came across the issue while working on adding Tracklist support to https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer. For now I'll just blacklist gnome-music for that method. Users won't be able to change songs from the extension's tracklist while using gnome-music but at least it won't crash. A side note, It would be nice if a complete set of metadata was provided also, the cover art url is missing.
This is a really easy fix, so I'm gonna make sure it gets fixed before the 3.24 release. So you can whitelist 3.24 and up. Please do open a separate bug about the other issue.
There's no way to get a player's version in mpris that I'm aware of? Users may very well be using different Shell and gnome-music versions. All I can do is once it's fixed remove the blacklist and note it as a known bug in versions < 3.24.
Created attachment 347872 [details] [review] mpris.py: Fix set_playlist calls Player.set_playlist requires a sixth argument.
Created attachment 347875 [details] [review] mpris: Fix set_playlist set_playlist had a discovery field added, but not all calls can be made with this field. Set a safe default value, which may not always be the required field, but should not bomb out.
I underestimated the problem here, the actual discovery status field needed is not actually known to the mpris code in this case. As an incomplete solution we set a default value that is ok for most model. This needs to be adressed further in a rewrite of the player code, so I added a comment in the code. I think this should at least stop it from crashing and burning in this case. Please do test and report back if it is not fixed. Attachment 347875 [details] pushed as a19af43 - mpris: Fix set_playlist