GNOME Bugzilla – Bug 705855
Crash when attempting to get properties over DBus
Last modified: 2013-09-02 16:23:24 UTC
From https://github.com/gnome-prototypes-team/gnome-music/issues/164 When nothing is playing, attempts to get any MPRISv2 property return: org.freedesktop.DBus.Python.AttributeError: Traceback (most recent call last):
+ Trace 232377
retval = candidate_method(self, *args, **keywords)
return self.GetAll(interface_name)[property_name]
'CanGoNext': self.player.has_next(),
tmp = self.currentTrack.copy()
Hm, right, we are supposed to select a default playlist here - that's how other players handle this. Maybe we should set Songs view as default.
+1 to comment #2, I think we should switch to Songs view then and start playback. On the other hand, current implementation will not play all the songs there - as we need to load them all via Load More.
(In reply to comment #2) > +1 to comment #2, I think we should switch to Songs view then and start > playback. Starting playback whenever someone wants to retrieve the status properties sounds a bit unusual...
Created attachment 252172 [details] [review] mpris: Don't check if has next and previous track if there's no playlist This prevents a crash when there is no selected playlist yet and an MPRIS client tries to get properties of org.mpris.MediaPlayer2.Player interface.
(In reply to comment #2) > +1 to comment #2, I think we should switch to Songs view then and start > playback. > > On the other hand, current implementation will not play all the songs there - > as we need to load them all via Load More. I attached a partial fix for this so that gnome-music won't crash when there's no selected playlist yet. Could you please check if it works? I'll probably commit this before the release today though - I don't want this crash to be in our first release. (In reply to comment #3) > Starting playback whenever someone wants to retrieve the status properties > sounds a bit unusual... He probably meant to play a song when Play() is called in MPRIS.
Created attachment 252173 [details] [review] player: Has next and previous track should be false if there's no playlist This prevents a crash when there is no selected playlist yet and an MPRIS client tries to get properties of org.mpris.MediaPlayer2.Player interface.
Comment on attachment 252173 [details] [review] player: Has next and previous track should be false if there's no playlist Argh, accidentally pushed it when I was supposed to attach it here. This fix is much better, the other one only handles mpris.
Branch for switching to Songs view then starting playback: https://github.com/gnome-prototypes-team/gnome-music/tree/default-playlist
Created attachment 253853 [details] [review] mpris: Use Songs view if has no playlist Select Songs view as playlist if there's none and Play is called.
Created attachment 253854 [details] [review] view: Make adding rows to models atomic This ensures that when row-inserted signal is emitted, the row already have values for all columns.
Created attachment 253855 [details] [review] player: Store current track as row reference Ensures that currentTrack iter won't get invalidated if a value changes in its row in the model.
Created attachment 253856 [details] [review] player: Sync buttons when playlist is modified Sync prev and next buttons when a track gets added or removed in the current playlist.
Created attachment 253857 [details] [review] view: Fix crash when artist is unknown
Comment on attachment 253853 [details] [review] mpris: Use Songs view if has no playlist Committed as 227ec60.
Comment on attachment 253854 [details] [review] view: Make adding rows to models atomic Committed as cd32ba0.
Comment on attachment 253855 [details] [review] player: Store current track as row reference Committed as e1a311f.
Comment on attachment 253856 [details] [review] player: Sync buttons when playlist is modified Committed as 25cfb09.
Comment on attachment 253857 [details] [review] view: Fix crash when artist is unknown Committed as 9aa86fd.