[gnome-music/wip/carlosg/tracker3: 22/68] grltrackerwrapper: Retrieve creation year for songs



commit 9231c816aa7ae1e6e209d1db96db5547c8eeec1d
Author: Sumaid Syed <sumaidsyed gmail com>
Date:   Sun Aug 4 22:47:34 2019 +0530

    grltrackerwrapper: Retrieve creation year for songs
    
    Based on the patches by Jean Felder
    
    https://gitlab.gnome.org/GNOME/gnome-music/issues/293

 gnomemusic/grilowrappers/grltrackerwrapper.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 0cde75e4..b6f68941 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -321,9 +321,11 @@ class GrlTrackerWrapper(GObject.GObject):
             nie:usageCounter(?song) AS ?play_count
             nmm:trackNumber(?song) AS ?track_number
             nmm:setNumber(nmm:musicAlbumDisc(?song)) AS ?album_disc_number
+            YEAR(?date) AS ?creation_date
             ?tag AS ?favourite
         WHERE {
             ?song a nmm:MusicPiece .
+            OPTIONAL { ?song nie:contentCreated ?date . }
             OPTIONAL {
                 ?song nao:hasTag ?tag .
                 FILTER (?tag = nao:predefined-tag-favorite)
@@ -414,9 +416,11 @@ class GrlTrackerWrapper(GObject.GObject):
             nie:usageCounter(?song) AS ?play_count
             nmm:trackNumber(?song) AS ?track_number
             nmm:setNumber(nmm:musicAlbumDisc(?song)) AS ?album_disc_number
+            YEAR(?date) AS ?creation_date
             ?tag AS ?favourite
         WHERE {
             ?song a nmm:MusicPiece .
+            OPTIONAL { ?song nie:contentCreated ?date . }
             OPTIONAL {
                 ?song nao:hasTag ?tag .
                 FILTER (?tag = nao:predefined-tag-favorite)
@@ -667,9 +671,11 @@ class GrlTrackerWrapper(GObject.GObject):
             nmm:setNumber(nmm:musicAlbumDisc(?song)) AS ?album_disc_number
             ?tag AS ?favourite
             nie:usageCounter(?song) AS ?play_count
+            YEAR(?date) AS ?creation_date
         WHERE {
             ?song a nmm:MusicPiece ;
                     nmm:musicAlbum ?album .
+            OPTIONAL { ?song nie:contentCreated ?date . }
             OPTIONAL { ?song nao:hasTag ?tag .
                        FILTER (?tag = nao:predefined-tag-favorite) } .
             FILTER ( tracker:id(?album) = %(album_id)s


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