[gnome-music/wip/mschraal/assorted-cleanups: 8/18] corealbum: Pass Application to init



commit d435c6c7ce746b67f14ebb90311f78383df05c95
Author: Marinus Schraal <mschraal gnome org>
Date:   Thu Mar 26 11:50:27 2020 +0100

    corealbum: Pass Application to init

 gnomemusic/corealbum.py                       | 6 +++---
 gnomemusic/grilowrappers/grltrackerwrapper.py | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/corealbum.py b/gnomemusic/corealbum.py
index f58ca51e..325526d8 100644
--- a/gnomemusic/corealbum.py
+++ b/gnomemusic/corealbum.py
@@ -41,15 +41,15 @@ class CoreAlbum(GObject.GObject):
     url = GObject.Property(type=str)
     year = GObject.Property(type=str, default="----")
 
-    def __init__(self, media, coremodel):
+    def __init__(self, application, media):
         """Initiate the CoreAlbum object
 
+        :param Application application: The application object
         :param Grl.Media media: A media object
-        :param CoreModel coremodel: The CoreModel to use models from
         """
         super().__init__()
 
-        self._coremodel = coremodel
+        self._coremodel = application.props.coremodel
         self._model = None
         self._selected = False
         self.update(media)
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 3b4adf42..7ff9a5a4 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -221,7 +221,7 @@ class GrlTrackerWrapper(GObject.GObject):
             if media.get_id() in self._album_ids.keys():
                 album = self._album_ids[media.get_id()]
             else:
-                album = CoreAlbum(media, self._coremodel)
+                album = CoreAlbum(self._application, media)
 
             album_ids[media.get_id()] = album
 
@@ -446,7 +446,7 @@ class GrlTrackerWrapper(GObject.GObject):
                 self._window.notifications_popup.pop_loading()
                 return
 
-            album = CoreAlbum(media, self._coremodel)
+            album = CoreAlbum(self._application, media)
             self._album_ids[media.get_id()] = album
             albums_added.append(album)
             if len(albums_added) == self._SPLICE_SIZE:


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