[gnome-music/wip/jfelder/albumwidget-cleanup] albumwidget: Repopulate the widget when restored



commit 5c910aa7440b52a112f0fcbd5fa1e402610c575b
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Sep 11 07:52:23 2018 +0200

    albumwidget: Repopulate the widget when restored

 gnomemusic/widgets/albumwidget.py | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index fd10af80..49c68861 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/gnomemusic/widgets/albumwidget.py
@@ -147,16 +147,7 @@ class AlbumWidget(Gtk.EventBox):
 
         self._player.connect('song-changed', self._update_model)
 
-        # If an album is playing, restore it.
-        if self._player.playing_playlist(
-                PlayerPlaylist.Type.ALBUM, self._album_id):
-            length = len(self._player.get_songs())
-            for i, song in enumerate(self._player.get_songs()):
-                self.add_item(None, None, song[0], length - (i + 1))
-            self.add_item(None, None, None, 0)
-            self._update_model(self._player)
-        else:
-            GLib.idle_add(grilo.populate_album_songs, album, self.add_item)
+        GLib.idle_add(grilo.populate_album_songs, album, self.add_item)
 
     @log
     def _set_composer_label(self, item):
@@ -239,6 +230,7 @@ class AlbumWidget(Gtk.EventBox):
                 self._disc_listbox.add(disc)
 
             self._set_duration_label()
+            self._update_model(self._player)
             self.show_all()
 
     @log


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