[gnome-music/wip/mschraal/assorted-cleanups: 16/30] coreartist: Pass Application to init



commit 7949ede2218f2b9ec6d079b9d94438798bb245c0
Author: Marinus Schraal <mschraal gnome org>
Date:   Thu Mar 26 13:21:46 2020 +0100

    coreartist: Pass Application to init

 gnomemusic/coreartist.py                      | 9 +++++++--
 gnomemusic/grilowrappers/grltrackerwrapper.py | 4 ++--
 2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/coreartist.py b/gnomemusic/coreartist.py
index 4a37d04f..b00a5e29 100644
--- a/gnomemusic/coreartist.py
+++ b/gnomemusic/coreartist.py
@@ -37,11 +37,16 @@ class CoreArtist(GObject.GObject):
     artist = GObject.Property(type=str)
     media = GObject.Property(type=Grl.Media)
 
-    def __init__(self, media, coremodel):
+    def __init__(self, application, media):
+        """Initiate the CoreArtist object
+
+        :param Application application: The application object
+        :param Grl.Media media: A media object
+        """
         super().__init__()
 
         self._cached_thumbnail_uri = None
-        self._coremodel = coremodel
+        self._coremodel = application.props.coremodel
         self._model = None
         self._selected = False
         self._thumbnail = None
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index e16d73c9..3ab56564 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -281,7 +281,7 @@ class GrlTrackerWrapper(GObject.GObject):
             if media.get_id() in self._artist_ids.keys():
                 artist = self._artist_ids[media.get_id()]
             else:
-                artist = CoreArtist(media, self._coremodel)
+                artist = CoreArtist(self._application, media)
 
             artist_ids[media.get_id()] = artist
 
@@ -502,7 +502,7 @@ class GrlTrackerWrapper(GObject.GObject):
                 self._window.notifications_popup.pop_loading()
                 return
 
-            artist = CoreArtist(media, self._coremodel)
+            artist = CoreArtist(self._application, media)
             self._artist_ids[media.get_id()] = artist
             artists_added.append(artist)
             if len(artists_added) == self._SPLICE_SIZE:


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