[gnome-music/wip/mschraal/favoritesupdate326] disclistboxwidget: Update favorites playlist



commit babaa96790fac6c31907fec847d0e495dee0a083
Author: Jean Felder <jean felder gmail com>
Date:   Tue Dec 12 22:28:37 2017 +0100

    disclistboxwidget: Update favorites playlist
    
    When marking a song as favorite, update the static favorites playlist.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784998

 gnomemusic/widgets/disclistboxwidget.py | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index 328d206..8fdfafe 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -28,6 +28,7 @@ from gi.repository import Gdk, GObject, Gtk
 
 from gnomemusic import log
 from gnomemusic.grilo import grilo
+from gnomemusic.playlists import Playlists, StaticPlaylists
 import gnomemusic.utils as utils
 
 
@@ -144,6 +145,8 @@ class DiscBox(Gtk.Box):
 
     }
 
+    _playlists = Playlists.get_default()
+
     def __repr__(self):
         return '<DiscBox>'
 
@@ -369,6 +372,8 @@ class DiscBox(Gtk.Box):
         # signal.
         favorite = song_widget.star_image.get_favorite()
         grilo.set_favorite(self._model[song_widget.itr][5], favorite)
+        self._playlists.update_static_playlist(StaticPlaylists.Favorites)
+
         return True
 
     @log


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]