[gnome-music] loadmore patch



commit d9880bc03688a0361bd44b432136842476cedfee
Author: Sai <suman sai14 gmail com>
Date:   Wed May 1 13:43:59 2013 +0530

    loadmore patch
    
    Signed-off-by: Seif Lotfy <seif lotfy com>

 src/query.js |    2 ++
 src/view.js  |    4 +++-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/query.js b/src/query.js
index 4382f64..7b9a3c5 100644
--- a/src/query.js
+++ b/src/query.js
@@ -26,6 +26,8 @@ const artist = 'SELECT DISTINCT rdf:type(?album) tracker:id(?album) as id (SELEC
 
 const album_count = 'SELECT COUNT(?album) AS childcount WHERE { ?album a nmm:MusicAlbum }';
 
+const artist_count = 'SELECT COUNT(DISTINCT ?artist) WHERE { ?artist a nmm:Artist . ?album nmm:performer 
?artist }';
+
 /*const songs = 'SELECT DISTINCT rdf:type(?song) tracker:id(?song) as id nie:url(?song) as url 
nie:title(?song) as title nmm:artistName(nmm:performer(?song)) as artist nie:title(nmm:musicAlbum(?song)) as 
album nfo:duration(?song) as duration { ?song a nmm:MusicPiece } (SELECT fn:year-from-dateTime(?c) WHERE { 
?_2 nmm:musicAlbum(?song); nie:contentCreated ?c; tracker:available "true" } LIMIT 1) as creation-date ORDER 
BY tracker:added(?song)';*/
 
 const songs = 'SELECT DISTINCT rdf:type(?song) tracker:id(?song) as id nie:url(?song) as url 
nie:title(?song) as title nmm:artistName(nmm:performer(?song)) as artist nie:title(nmm:musicAlbum(?song)) as 
album nfo:duration(?song) as duration { ?song a nmm:MusicPiece } ORDER BY tracker:added(?song)';
diff --git a/src/view.js b/src/view.js
index ce6fde9..880cd53 100644
--- a/src/view.js
+++ b/src/view.js
@@ -55,7 +55,7 @@ const LoadMoreButton = new Lang.Class({
         this._block = false;
         this._counter = counter;
         let child = new Gtk.Grid({ column_spacing: 10,
-                                   hexpand: true,
+                                   hexpand: false,
                                    halign: Gtk.Align.CENTER,
                                    visible: true });
 
@@ -398,6 +398,7 @@ const Artists = new Lang.Class({
         this.parent("Artists", header_bar);
         this.player = player;
         this._artists = {};
+        this.countQuery = Query.artist_count;
         this._artistAlbumsWidget = new Gtk.Frame({
             shadow_type:    Gtk.ShadowType.NONE
         });
@@ -449,6 +450,7 @@ const Artists = new Lang.Class({
     },
 
     _addItem: function (source, param, item) {
+        this._offset += 1;
         if( item == null )
             return
         var artist = "Unknown"


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