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 784998 - Favorites are only added to playlist after restart
Favorites are only added to playlist after restart
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.24.x
Other Linux
: Normal minor
: ---
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks:
 
 
Reported: 2017-07-16 15:00 UTC by tim
Modified: 2018-01-08 12:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mp3 with embedded cover (1.95 MB, audio/mpeg)
2017-11-03 19:44 UTC, tim
  Details
disclistboxwidget: update favorite playlist (1.24 KB, patch)
2017-11-09 15:08 UTC, Jean Felder
none Details | Review
disclistboxwidget: update favorite playlist (1.29 KB, patch)
2017-12-12 21:35 UTC, Jean Felder
accepted-commit_now Details | Review

Description tim 2017-07-16 15:00:43 UTC
Steps to reproduce:

1. Mark a song as favorite.
2. Select the playlist tab and favorites.

Result: 

The favorite song wasn't be added.


Workaround:

Restart gnome-music. Now the song is been added to the playlist.
Comment 1 Marinus Schraal 2017-07-17 11:19:50 UTC
Yeah this is a known issue with the playlist view not being updated/triggered since we redid some internals and made it mostly async. The current playlist code is not up to standards, but it is what we have to work with for now.

We need to figure out where in the chain it fails, someone investigating this would be awesome.
Comment 3 Jean Felder 2017-11-09 15:08:56 UTC
Created attachment 363294 [details] [review]
disclistboxwidget: update favorite playlist

When marking a song as favorite, update Static Favorites Playlist
Comment 4 Marinus Schraal 2017-12-12 15:54:44 UTC
Review of attachment 363294 [details] [review]:

lgtm
Comment 5 Marinus Schraal 2017-12-12 19:10:52 UTC
Review of attachment 363294 [details] [review]:

Ok was waiting to test it, but it works fine.

::: gnomemusic/widgets/disclistboxwidget.py
@@ +32,3 @@
 import gnomemusic.utils as utils
 
+playlists = Playlists.get_default()

this can be moved inside the class

@@ +373,3 @@
         favorite = song_widget.star_image.get_favorite()
         grilo.set_favorite(self._model[song_widget.itr][5], favorite)
+        playlists.update_static_playlist(StaticPlaylists.Favorites)

The FIXME a few lines above also applies to this, but it will do for now.
Comment 6 Jean Felder 2017-12-12 21:35:54 UTC
Created attachment 365466 [details] [review]
disclistboxwidget: update favorite playlist

When marking a song as favorite, update Static Favorites Playlist
Comment 7 Marinus Schraal 2018-01-08 10:43:56 UTC
Review of attachment 365466 [details] [review]:

lgtm
Comment 8 Marinus Schraal 2018-01-08 12:13:28 UTC
Merged in https://gitlab.gnome.org/GNOME/gnome-music/merge_requests/23 . Adding it to 3.26 too.

Thanks for the patch.