[gnome-music] Clear model when switching to new album



commit 67285e4ba8c9bddf599ce15562cf071ee091cde4
Author: Seif Lotfy <seif lotfy com>
Date:   Fri May 17 20:33:52 2013 +0200

    Clear model when switching to new album
    
    We need to clear the model when switching to a new album so songs are not
    appended

 src/widgets.js |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/widgets.js b/src/widgets.js
index 6870a16..e0ff3d6 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -165,6 +165,7 @@ const AlbumWidget = new Lang.Class({
             this.model = cachedPlaylist;
             this.updateModel(this.player, cachedPlaylist, this.player.currentTrack);
         } else {
+            this.model.clear();
             var tracks = [];
             grilo.getAlbumSongs(item.get_id(), Lang.bind(this, function (source, prefs, track) {
                 if (track != null) {
@@ -202,6 +203,7 @@ const AlbumWidget = new Lang.Class({
             this.ui.get_object("released_label_info").set_text("----");
         this.player.connect('playlist-item-changed', Lang.bind(this, this.updateModel));
         this.emit('loaded')
+
     },
 
     updateModel: function(player, playlist, currentIter){


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