[gnome-music/wip/mschraal/file-exists-async: 7/9] artcache/storeart: Emit signal emission after I/O finish
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/file-exists-async: 7/9] artcache/storeart: Emit signal emission after I/O finish
- Date: Tue, 17 Aug 2021 12:42:36 +0000 (UTC)
commit c0a6211666efa0f2c747971b2f3f59f34a8babc5
Author: Marinus Schraal <mschraal gnome org>
Date: Sun Aug 15 22:58:04 2021 +0200
artcache/storeart: Emit signal emission after I/O finish
The point of the AsyncQueue is to not do too much I/O simultanously.
That involves all steps, including closing streams properly.
gnomemusic/artcache.py | 5 ++++-
gnomemusic/storeart.py | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/artcache.py b/gnomemusic/artcache.py
index 878eeed52..6a53776f0 100644
--- a/gnomemusic/artcache.py
+++ b/gnomemusic/artcache.py
@@ -55,6 +55,7 @@ class ArtCache(GObject.GObject):
self._coreobject = None
self._default_icon = None
+ self._surface = None
def start(self, coreobject, size, scale):
"""Start the cache query
@@ -120,7 +121,7 @@ class ArtCache(GObject.GObject):
or isinstance(self._coreobject, CoreSong)):
surface = make_icon_frame(surface, self._size, self._scale)
- self.emit("finished", surface)
+ self._surface = surface
def _close_stream(self, stream, result, data):
try:
@@ -128,3 +129,5 @@ class ArtCache(GObject.GObject):
except GLib.Error as error:
self._log.warning(
"Error: {}, {}".format(error.domain, error.message))
+
+ self.emit("finished", self._surface)
diff --git a/gnomemusic/storeart.py b/gnomemusic/storeart.py
index 89f13c0ec..a1ff57664 100644
--- a/gnomemusic/storeart.py
+++ b/gnomemusic/storeart.py
@@ -166,8 +166,6 @@ class StoreArt(GObject.Object):
self._coreobject.props.media.set_thumbnail(cache_file.get_uri())
self._coreobject.props.thumbnail = cache_file.get_uri()
- self.emit("finished")
-
tmp_file.delete_async(
GLib.PRIORITY_LOW, None, self._delete_callback, None)
@@ -177,3 +175,5 @@ class StoreArt(GObject.Object):
except GLib.Error as error:
self._log.warning(
"Error: {}, {}".format(error.domain, error.message))
+
+ self.emit("finished")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]