[gnome-music/wip/mschraal/albumview-covers-on-demand: 3/3] albumsview: Re-add timeout based cover loading



commit e23793c91fc80404b5841ee4a4eb2c7737e432b7
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun Oct 20 16:33:07 2019 +0200

    albumsview: Re-add timeout based cover loading
    
    Besides on demand loading, a slow timeout based loading is added. This
    will eventually lookup all covers to aid a visual search.

 gnomemusic/views/albumsview.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index 6fb3eda6..7836f86d 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -66,6 +66,7 @@ class AlbumsView(Gtk.Stack):
         self._headerbar = self._window._headerbar
         self._adjustment_timeout_id = None
         self._viewport = self._scrolled_window.get_child()
+        self._widget_counter = 1
 
         model = self._window._app.props.coremodel.props.albums_sort
         self._flowbox.bind_model(model, self._create_widget)
@@ -164,6 +165,11 @@ class AlbumsView(Gtk.Stack):
             "selected", corealbum, "selected",
             GObject.BindingFlags.BIDIRECTIONAL)
 
+        GLib.timeout_add(
+            self._widget_counter * 250, album_widget.retrieve,
+            priority=GLib.PRIORITY_LOW)
+        self._widget_counter = self._widget_counter + 1
+
         return album_widget
 
     def _back_button_clicked(self, widget, data=None):


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