[gnome-music/wip/mschraal/prioritypool-v3: 3/5] albumsview: Use PriorityPool




commit a1b09b172fddd2e28f349f1af0f846f8ed920680
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue Feb 1 15:59:53 2022 +0100

    albumsview: Use PriorityPool
    
    Give current albums in viewport priority.

 gnomemusic/views/albumsview.py | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index 1bc8d3984..83b909c06 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -27,6 +27,7 @@ import math
 from gettext import gettext as _
 from gi.repository import Gdk, GLib, GObject, Gtk
 
+from gnomemusic.prioritypool import PriorityPool
 from gnomemusic.widgets.headerbar import HeaderBar
 from gnomemusic.widgets.albumcover import AlbumCover
 from gnomemusic.widgets.albumwidget import AlbumWidget
@@ -67,6 +68,7 @@ class AlbumsView(Gtk.Stack):
         self._window = application.props.window
         self._headerbar = self._window._headerbar
         self._adjustment_timeout_id = 0
+        self._priority_pool = PriorityPool()
         self._viewport = self._scrolled_window.get_child()
         self._widget_counter = 1
         self._ctrl_hold = False
@@ -143,6 +145,9 @@ class AlbumsView(Gtk.Stack):
                 retrieve_list = children[i:i + retrieve_covers]
                 break
 
+        corealbums = [cover.props.corealbum for cover in retrieve_list]
+        self._priority_pool.add(corealbums, True)
+
         for albumcover in retrieve_list:
             albumcover.retrieve()
 


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