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



commit 5c1d6ef239667e7d9e9b8eb2f08ab286719ae26e
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 8ddf0aa6..4cf33298 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]