[gnome-music/wip/mschraal/assorted-art-fixes: 1/2] Simplify art transition (incomplete)
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/assorted-art-fixes: 1/2] Simplify art transition (incomplete)
- Date: Fri, 20 Nov 2020 15:46:28 +0000 (UTC)
commit 6704455f2be184aa37dfd80934563f92cd6d09ac
Author: Marinus Schraal <mschraal gnome org>
Date: Wed Nov 11 23:32:06 2020 +0100
Simplify art transition (incomplete)
gnomemusic/albumart.py | 2 +-
gnomemusic/artcache.py | 14 ++------------
gnomemusic/artistart.py | 2 +-
gnomemusic/corealbum.py | 2 +-
gnomemusic/coreartist.py | 2 +-
gnomemusic/coresong.py | 2 +-
gnomemusic/mpris.py | 2 +-
gnomemusic/songart.py | 2 +-
8 files changed, 9 insertions(+), 19 deletions(-)
---
diff --git a/gnomemusic/albumart.py b/gnomemusic/albumart.py
index 2d3f14eb3..70d4aec32 100644
--- a/gnomemusic/albumart.py
+++ b/gnomemusic/albumart.py
@@ -64,7 +64,7 @@ class AlbumArt(GObject.GObject):
self._artist, self._album, "album")
if (not success
or not thumb_file.query_exists()):
- self._corealbum.props.thumbnail = "loading"
+ self._corealbum.props.thumbnail = "generic"
return False
self._corealbum.props.thumbnail = thumb_file.get_uri()
diff --git a/gnomemusic/artcache.py b/gnomemusic/artcache.py
index d22ae44c8..a42355dea 100644
--- a/gnomemusic/artcache.py
+++ b/gnomemusic/artcache.py
@@ -122,12 +122,10 @@ def _make_icon_frame(
class DefaultIcon(GObject.GObject):
- """Provides the symbolic fallback and loading icons."""
+ """Provides the symbolic fallback icons."""
class Type(Enum):
ARTIST = "avatar-default-symbolic"
- ARTIST_LOADING = "content-loading-symbolic"
- LOADING = "content-loading-symbolic"
MUSIC = "folder-music-symbolic"
_cache: Dict[
@@ -193,7 +191,6 @@ class ArtCache(GObject.GObject):
self._coreobject = None
self._default_icon = None
- self._loading_icon = None
def query(self, coreobject):
"""Start the cache query
@@ -203,22 +200,15 @@ class ArtCache(GObject.GObject):
self._coreobject = coreobject
if isinstance(coreobject, CoreArtist):
- self._loading_icon = DefaultIcon().get(
- DefaultIcon.Type.ARTIST_LOADING, self._size, self._scale, True)
self._default_icon = DefaultIcon().get(
DefaultIcon.Type.ARTIST, self._size, self._scale, True)
elif (isinstance(coreobject, CoreAlbum)
or isinstance(coreobject, CoreSong)):
- self._loading_icon = DefaultIcon().get(
- DefaultIcon.Type.LOADING, self._size, self._scale)
self._default_icon = DefaultIcon().get(
DefaultIcon.Type.MUSIC, self._size, self._scale)
thumbnail_uri = coreobject.props.thumbnail
- if thumbnail_uri == "loading":
- self.emit("result", self._loading_icon)
- return
- elif thumbnail_uri == "generic":
+ if thumbnail_uri == "generic":
self.emit("result", self._default_icon)
return
diff --git a/gnomemusic/artistart.py b/gnomemusic/artistart.py
index 9cb0e3c62..7461bd823 100644
--- a/gnomemusic/artistart.py
+++ b/gnomemusic/artistart.py
@@ -52,7 +52,7 @@ class ArtistArt(GObject.GObject):
self._artist, None, "artist")
if (not success
or not thumb_file.query_exists()):
- self._coreartist.props.thumbnail = "loading"
+ self._coreartist.props.thumbnail = "generic"
return False
self._coreartist.props.thumbnail = thumb_file.get_uri()
diff --git a/gnomemusic/corealbum.py b/gnomemusic/corealbum.py
index 4ab1569cc..97c6b0efb 100644
--- a/gnomemusic/corealbum.py
+++ b/gnomemusic/corealbum.py
@@ -140,7 +140,7 @@ class CoreAlbum(GObject.GObject):
:rtype: string
"""
if self._thumbnail is None:
- self._thumbnail = "loading"
+ self._thumbnail = "generic"
AlbumArt(self._application, self)
return self._thumbnail
diff --git a/gnomemusic/coreartist.py b/gnomemusic/coreartist.py
index 1630d3fb6..7522b2f15 100644
--- a/gnomemusic/coreartist.py
+++ b/gnomemusic/coreartist.py
@@ -115,7 +115,7 @@ class CoreArtist(GObject.GObject):
:rtype: string
"""
if self._thumbnail is None:
- self._thumbnail = "loading"
+ self._thumbnail = "generic"
ArtistArt(self._application, self)
return self._thumbnail
diff --git a/gnomemusic/coresong.py b/gnomemusic/coresong.py
index 862cb66a5..7c327978e 100644
--- a/gnomemusic/coresong.py
+++ b/gnomemusic/coresong.py
@@ -135,7 +135,7 @@ class CoreSong(GObject.GObject):
:rtype: string
"""
if self._thumbnail is None:
- self._thumbnail = "loading"
+ self._thumbnail = "generic"
SongArt(self._application, self)
return self._thumbnail
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 8a8b90c9d..ddb54a740 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -376,7 +376,7 @@ class MPRIS(DBusInterface):
metadata['xesam:trackNumber'] = GLib.Variant('i', track_nr)
art_url = coresong.props.thumbnail
- if art_url not in ["generic", "loading"]:
+ if art_url != "generic":
metadata['mpris:artUrl'] = GLib.Variant('s', art_url)
return metadata
diff --git a/gnomemusic/songart.py b/gnomemusic/songart.py
index 450d59add..3311c42f7 100644
--- a/gnomemusic/songart.py
+++ b/gnomemusic/songart.py
@@ -64,7 +64,7 @@ class SongArt(GObject.GObject):
self._artist, self._album, "album")
if (not success
or not thumb_file.query_exists()):
- self._coresong.props.thumbnail = "loading"
+ self._coresong.props.thumbnail = "generic"
return False
self._coresong.props.thumbnail = thumb_file.get_uri()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]