After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779052 - MPRIS TrackList GoTo Method Crashes gnome-music
MPRIS TrackList GoTo Method Crashes gnome-music
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
unspecified
Other Linux
: Low minor
: ---
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks: 778870
 
 
Reported: 2017-02-22 07:20 UTC by Jason Gray
Modified: 2017-03-13 21:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mpris.py: Fix set_playlist calls (1.37 KB, patch)
2017-03-13 20:32 UTC, Marinus Schraal
none Details | Review
mpris: Fix set_playlist (1.10 KB, patch)
2017-03-13 21:02 UTC, Marinus Schraal
committed Details | Review

Description Jason Gray 2017-02-22 07:20:13 UTC
Calling the GoTo method with a valid TrackId crashes gnome-music.

Traceback (most recent call last):
  • File "/usr/lib/python3/dist-packages/gnomemusic/mpris.py", line 73 in on_method_call
    result = getattr(self, method_name)(*args)
  • File "/usr/lib/python3/dist-packages/gnomemusic/mpris.py", line 604 in GoTo
    self.player.playlistField)
TypeError: set_playlist() missing 1 required positional argument: 'discovery_status_field'

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...
Comment 1 Marinus Schraal 2017-02-23 12:32:24 UTC
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.
Comment 2 Jason Gray 2017-02-24 02:40:17 UTC
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.
Comment 3 Marinus Schraal 2017-02-24 11:12:37 UTC
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.
Comment 4 Jason Gray 2017-02-25 10:38:40 UTC
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.
Comment 5 Marinus Schraal 2017-03-13 20:32:16 UTC
Created attachment 347872 [details] [review]
mpris.py: Fix set_playlist calls

Player.set_playlist requires a sixth argument.
Comment 6 Marinus Schraal 2017-03-13 21:02:58 UTC
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.
Comment 7 Marinus Schraal 2017-03-13 21:10:14 UTC
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