[gnome-music/wip/mschraal/core] artistsview: Cleanup unused stuff



commit a1640e5ad013030bd3ebb7d2a2d8fc84d2a23c1a
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun Jun 23 23:18:52 2019 +0200

    artistsview: Cleanup unused stuff

 gnomemusic/views/artistsview.py          | 46 ++++----------------------------
 gnomemusic/widgets/artistalbumswidget.py |  4 +--
 2 files changed, 7 insertions(+), 43 deletions(-)
---
diff --git a/gnomemusic/views/artistsview.py b/gnomemusic/views/artistsview.py
index 425ae404..c9117378 100644
--- a/gnomemusic/views/artistsview.py
+++ b/gnomemusic/views/artistsview.py
@@ -116,22 +116,17 @@ class ArtistsView(BaseView):
             row.props.selected = not row.props.selected
             return
 
-        print(row.props.artist.props.artist, row, row.get_child())
-
         # Prepare a new artist_albums_widget here
-        artist = row.props.artist.props.artist
-        artist_media = row.props.artist.props.media
-
-        model = self._window._app._coremodel.get_artists_model_full(row.props.artist)
+        coreartist = row.props.artist
+        model = self._window._app._coremodel.get_artists_model_full(coreartist)
 
         new_artist_albums_widget = Gtk.Frame(
             shadow_type=Gtk.ShadowType.NONE, hexpand=True)
         self._view.add(new_artist_albums_widget)
 
-        albums = self._window._app._coremodel.get_artist_albums(row.props.artist)
+        albums = self._window._app._coremodel.get_artist_albums(coreartist)
         artist_albums = ArtistAlbumsWidget(
-            artist, albums, self.player, self._window, False, model)
-        # self._artists[artist.casefold()]['widget'] = artist_albums
+            coreartist, albums, self.player, self._window, False, model)
         new_artist_albums_widget.add(artist_albums)
         new_artist_albums_widget.show()
 
@@ -141,41 +136,10 @@ class ArtistsView(BaseView):
 
         return
 
-    @log
-    def _add_item(self, source, param, item, remaining=0, data=None):
-        if (not item and remaining == 0):
-            self._window.notifications_popup.pop_loading()
-            self._sidebar.show()
-            return
-        self._offset += 1
-        artist = utils.get_artist_name(item)
-        row = None
-        if not artist.casefold() in self._artists:
-            # populate sidebar
-            row = SidebarRow()
-            row.props.text = artist
-            row.connect('notify::selected', self._on_selection_changed)
-            self.bind_property('selection-mode', row, 'selection-mode')
-            self._sidebar.add(row)
-
-            self._artists[artist.casefold()] = {
-                'albums': [],
-                'widget': None
-            }
-
-        self._artists[artist.casefold()]['albums'].append(item)
-
-        if (row is not None
-                and len(self._sidebar) == 1):
-            self._sidebar.select_row(row)
-            self._sidebar.emit('row-activated', row)
-
     @log
     def _populate(self, data=None):
         """Populates the view"""
-        # self._window.notifications_popup.push_loading()
-        # grilo.populate_artists(self._offset, self._add_item)
-        # self._init = True
+        pass
 
     @log
     def _on_sidebar_clicked(self, gesture, n_press, x, y):
diff --git a/gnomemusic/widgets/artistalbumswidget.py b/gnomemusic/widgets/artistalbumswidget.py
index 8bd8ecb6..90ff8df1 100644
--- a/gnomemusic/widgets/artistalbumswidget.py
+++ b/gnomemusic/widgets/artistalbumswidget.py
@@ -55,12 +55,12 @@ class ArtistAlbumsWidget(Gtk.Box):
 
     @log
     def __init__(
-            self, artist, albums, player, window,
+            self, coreartist, albums, player, window,
             selection_mode_allowed=False, model=None):
         super().__init__(orientation=Gtk.Orientation.VERTICAL)
         self._model = model
         self._player = player
-        self._artist = artist
+        self._artist = coreartist.props.artist
         self._window = window
         self._selection_mode_allowed = selection_mode_allowed
 


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