Skip to content

mpris: Update the tracklist once the song has changed

Jean Felder requested to merge wip/jfelder/3-34-mpris-tracklist-crash into gnome-3-34

When a tracklist changes (a new playlist has been loaded in the CoreModel), the MPRIS tracklist needs to be updated by calling _update_songs_list method. It relies on the current_position property from the Player to update this list. However, this property has not been updated yet. Indeed, It will be updated by the play method of the Player. This incorrect call can result in a crash if the new playlist has less elements than the previous one.

It turns out that the update_songs_list method is called two times every time a new playlist is loaded. The first time once the new playlist is loaded, and the other time once the new song starts playing.

Fix the issue by removing the first _update_songs_list call. The MPRIS tracklist is already correctly updated once the new song starts playing.

Closes: #322 (closed) (cherry picked from commit 620c0eb5)

Merge request reports