[gnome-music/wip/mschraal/tageditor-13feb2020: 5/25] grltrackerwrapper: Retrieve creation year for songs



commit 8cf7f97ab46943e1c4a315f101fdbe7fd04e546c
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 526d89c5..77e06835 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -309,9 +309,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)
@@ -389,9 +391,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)
@@ -641,9 +645,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]