[gnome-music/wip/mschraal/art-fixes-regressions: 5/5] corealbum, coreartist, coresong: Set media thumbnail




commit 029b4268d8ba5ea8f86ac1bd4a54cf5d52444c10
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue Sep 7 02:26:22 2021 +0200

    corealbum,coreartist,coresong: Set media thumbnail
    
    A follow up of the parent commit, besides setting the coreobject
    thumbnail uri it is good practice to also set the media thumbnail field.
    
    Do this in the respective Core{Album,Artist,Song} objects alike.

 gnomemusic/corealbum.py  | 3 +++
 gnomemusic/coreartist.py | 3 +++
 gnomemusic/coresong.py   | 3 +++
 3 files changed, 9 insertions(+)
---
diff --git a/gnomemusic/corealbum.py b/gnomemusic/corealbum.py
index 9ce98772a..6db2c051b 100644
--- a/gnomemusic/corealbum.py
+++ b/gnomemusic/corealbum.py
@@ -153,3 +153,6 @@ class CoreAlbum(GObject.GObject):
         :param string value: uri or "generic"
         """
         self._thumbnail = value
+
+        if self._thumbnail != "generic":
+            self.props.media.set_thumbnail(self._thumbnail)
diff --git a/gnomemusic/coreartist.py b/gnomemusic/coreartist.py
index 4da047190..62915a9f0 100644
--- a/gnomemusic/coreartist.py
+++ b/gnomemusic/coreartist.py
@@ -127,3 +127,6 @@ class CoreArtist(GObject.GObject):
         :param string value: uri or "generic"
         """
         self._thumbnail = value
+
+        if self._thumbnail != "generic":
+            self.props.media.set_thumbnail(self._thumbnail)
diff --git a/gnomemusic/coresong.py b/gnomemusic/coresong.py
index 064a6f8d7..833ee1c43 100644
--- a/gnomemusic/coresong.py
+++ b/gnomemusic/coresong.py
@@ -148,6 +148,9 @@ class CoreSong(GObject.GObject):
         """
         self._thumbnail = value
 
+        if self._thumbnail != "generic":
+            self.props.media.set_thumbnail(self._thumbnail)
+
     def update(self, media: Grl.Media) -> None:
         self.props.media = media
         self.props.album = utils.get_album_title(media)


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