[gnome-music/wip/mschraal/match-grilo-priorities: 4/4] Match Grilo priorties in Music
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/match-grilo-priorities: 4/4] Match Grilo priorties in Music
- Date: Mon, 31 Jan 2022 17:30:27 +0000 (UTC)
commit b55832a9718185483a23ef180b110d61b8691b96
Author: Marinus Schraal <mschraal gnome org>
Date: Mon Jan 31 10:58:24 2022 +0100
Match Grilo priorties in Music
Grilo GLib priorities are quite low and this seemingly makes them file
up when higher priorities tasks are around. With Music task priority
being higher, this actually makes perceived processing slower as the
Music tasks queue up with Grilo tasks not being handled.
Match the Grilo priorities in Music to subjectively speed up initial
loading of items.
gnomemusic/artcache.py | 4 ++--
gnomemusic/embeddedart.py | 8 ++++----
gnomemusic/fileexistsasync.py | 2 +-
gnomemusic/storeart.py | 8 ++++----
4 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/gnomemusic/artcache.py b/gnomemusic/artcache.py
index 967ac2798..9162c19ee 100644
--- a/gnomemusic/artcache.py
+++ b/gnomemusic/artcache.py
@@ -84,7 +84,7 @@ class ArtCache(GObject.GObject):
thumb_file = Gio.File.new_for_uri(thumbnail_uri)
if thumb_file:
thumb_file.read_async(
- GLib.PRIORITY_DEFAULT, None, self._open_stream, None)
+ GLib.PRIORITY_DEFAULT_IDLE, None, self._open_stream, None)
return
self.emit("finished", self._default_icon)
@@ -111,7 +111,7 @@ class ArtCache(GObject.GObject):
return
stream.close_async(
- GLib.PRIORITY_DEFAULT, None, self._close_stream, None)
+ GLib.PRIORITY_DEFAULT_IDLE, None, self._close_stream, None)
surface = Gdk.cairo_surface_create_from_pixbuf(
pixbuf, self._scale, None)
diff --git a/gnomemusic/embeddedart.py b/gnomemusic/embeddedart.py
index 567b11b1c..0de00f791 100644
--- a/gnomemusic/embeddedart.py
+++ b/gnomemusic/embeddedart.py
@@ -163,11 +163,11 @@ class EmbeddedArt(GObject.GObject):
self._lookup_cover_in_directory()
else:
self._file.create_async(
- Gio.FileCreateFlags.NONE, GLib.PRIORITY_DEFAULT, None,
+ Gio.FileCreateFlags.NONE, GLib.PRIORITY_DEFAULT_IDLE, None,
self._output_stream_created, pixbuf)
finally:
stream.close_async(
- GLib.PRIORITY_DEFAULT, None, self._stream_closed)
+ GLib.PRIORITY_DEFAULT_IDLE, None, self._stream_closed)
def _output_stream_created(
self, stream: Gio.FileOutputStream, result: Gio.AsyncResult,
@@ -194,7 +194,7 @@ class EmbeddedArt(GObject.GObject):
self.emit("art-found", True)
finally:
output_stream.close_async(
- GLib.PRIORITY_DEFAULT, None, self._stream_closed)
+ GLib.PRIORITY_DEFAULT_IDLE, None, self._stream_closed)
def _stream_closed(
self, stream: Gio.OutputStream, result: Gio.AsyncResult) -> None:
@@ -208,7 +208,7 @@ class EmbeddedArt(GObject.GObject):
self._media_art.uri_async(
MediaArt.Type.ALBUM, MediaArt.ProcessFlags.NONE,
self._coreobject.props.url, self._artist, self._album,
- GLib.PRIORITY_DEFAULT, None, self._uri_async_cb, None)
+ GLib.PRIORITY_DEFAULT_IDLE, None, self._uri_async_cb, None)
def _uri_async_cb(self, src, result, data):
try:
diff --git a/gnomemusic/fileexistsasync.py b/gnomemusic/fileexistsasync.py
index 18a09b6dc..3433f1606 100644
--- a/gnomemusic/fileexistsasync.py
+++ b/gnomemusic/fileexistsasync.py
@@ -47,7 +47,7 @@ class FileExistsAsync(GObject.GObject):
"""
thumb_file.query_info_async(
Gio.FILE_ATTRIBUTE_STANDARD_TYPE, Gio.FileQueryInfoFlags.NONE,
- GLib.PRIORITY_DEFAULT, None, self._on_query_info_finished)
+ GLib.PRIORITY_DEFAULT_IDLE, None, self._on_query_info_finished)
def _on_query_info_finished(
self, thumb_file: Gio.File, res: Gio.AsyncResult) -> None:
diff --git a/gnomemusic/storeart.py b/gnomemusic/storeart.py
index 0b09a5be8..7cbec9dad 100644
--- a/gnomemusic/storeart.py
+++ b/gnomemusic/storeart.py
@@ -85,7 +85,7 @@ class StoreArt(GObject.Object):
cache_dir_file = Gio.File.new_for_path(cache_dir)
cache_dir_file.query_info_async(
Gio.FILE_ATTRIBUTE_ACCESS_CAN_READ, Gio.FileQueryInfoFlags.NONE,
- GLib.PRIORITY_DEFAULT, None, self._cache_dir_info_read, uri)
+ GLib.PRIORITY_DEFAULT_IDLE, None, self._cache_dir_info_read, uri)
def _cache_dir_info_read(self, cache_dir_file, res, uri):
try:
@@ -126,11 +126,11 @@ class StoreArt(GObject.Object):
self.emit("finished")
else:
self._file.create_async(
- Gio.FileCreateFlags.NONE, GLib.PRIORITY_DEFAULT, None,
+ Gio.FileCreateFlags.NONE, GLib.PRIORITY_DEFAULT_IDLE, None,
self._output_stream_created, pixbuf)
finally:
stream.close_async(
- GLib.PRIORITY_DEFAULT, None, self._stream_closed)
+ GLib.PRIORITY_DEFAULT_IDLE, None, self._stream_closed)
def _output_stream_created(
self, stream: Gio.FileOutputStream, result: Gio.AsyncResult,
@@ -157,7 +157,7 @@ class StoreArt(GObject.Object):
finally:
self.emit("finished")
output_stream.close_async(
- GLib.PRIORITY_DEFAULT, None, self._stream_closed)
+ GLib.PRIORITY_DEFAULT_IDLE, None, self._stream_closed)
def _stream_closed(
self, stream: Gio.OutputStream, result: Gio.AsyncResult) -> None:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]