Trying to make the album caching better
This commit is contained in:
@@ -479,7 +479,8 @@ class CacheManager(metaclass=Singleton):
|
||||
if self.browse_by_tags else self.server.get_album_list)
|
||||
|
||||
# TODO make this invalidate instead of delete
|
||||
if force and self.cache.get(cache_name, {}).get(type_):
|
||||
# TODO invalidate if random as well.
|
||||
if False and self.cache.get(cache_name, {}).get(type_):
|
||||
with self.cache_lock:
|
||||
self.cache[cache_name][type_] = []
|
||||
self.save_cache_info()
|
||||
@@ -494,8 +495,12 @@ class CacheManager(metaclass=Singleton):
|
||||
yield 'network barrier'
|
||||
before_download()
|
||||
page = (
|
||||
server_fn(type_, size=page_size, offset=offset).album
|
||||
or [])
|
||||
server_fn(
|
||||
type_,
|
||||
size=page_size,
|
||||
offset=offset,
|
||||
**params,
|
||||
).album or [])
|
||||
|
||||
with self.cache_lock:
|
||||
if not self.cache[cache_name].get(type_):
|
||||
|
@@ -179,7 +179,7 @@ class AlbumsPanel(Gtk.Box):
|
||||
self.emit(
|
||||
'refresh-window',
|
||||
{'current_album_sort': new_active_sort},
|
||||
False,
|
||||
True,
|
||||
)
|
||||
|
||||
def on_alphabetical_type_change(self, combo):
|
||||
@@ -188,7 +188,7 @@ class AlbumsPanel(Gtk.Box):
|
||||
self.emit(
|
||||
'refresh-window',
|
||||
{'current_album_alphabetical_sort': new_active_alphabetical_sort},
|
||||
False,
|
||||
True,
|
||||
)
|
||||
|
||||
def on_genre_change(self, combo):
|
||||
@@ -199,7 +199,7 @@ class AlbumsPanel(Gtk.Box):
|
||||
self.emit(
|
||||
'refresh-window',
|
||||
{'current_album_genre': new_active_genre},
|
||||
False,
|
||||
True,
|
||||
)
|
||||
|
||||
def on_year_changed(self, entry):
|
||||
@@ -212,17 +212,17 @@ class AlbumsPanel(Gtk.Box):
|
||||
|
||||
if self.to_year_entry == entry:
|
||||
self.grid.update_params(to_year=year)
|
||||
self.emit('refresh-window', {'current_album_to_year': year}, False)
|
||||
self.emit('refresh-window', {'current_album_to_year': year}, True)
|
||||
else:
|
||||
self.grid.update_params(from_year=year)
|
||||
self.emit(
|
||||
'refresh-window', {'current_album_from_year': year}, False)
|
||||
'refresh-window', {'current_album_from_year': year}, True)
|
||||
|
||||
def on_grid_cover_clicked(self, grid, id):
|
||||
self.emit(
|
||||
'refresh-window',
|
||||
{'selected_album_id': id},
|
||||
False,
|
||||
True,
|
||||
)
|
||||
|
||||
|
||||
|
@@ -158,7 +158,7 @@ class CoverArtGrid(Gtk.ScrolledWindow):
|
||||
|
||||
GLib.idle_add(
|
||||
reflow_grid,
|
||||
old_len != len(self.list_store),
|
||||
old_len != len(self.list_store) or force,
|
||||
selected_index,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user