[gnome-music/wip/jfelder/query-filelastaccessed] query: Retrieve last_played key



commit e56bb27e232b0289bd2abb929e2c4e7919a0da63
Author: Jean Felder <jfelder src gnome org>
Date:   Thu May 30 11:54:30 2019 +0200

    query: Retrieve last_played key
    
    This key is used by the metadata property of MPRIS.

 gnomemusic/grilo.py | 1 +
 gnomemusic/query.py | 3 +++
 2 files changed, 4 insertions(+)
---
diff --git a/gnomemusic/grilo.py b/gnomemusic/grilo.py
index 1d811c73..d089ecd8 100644
--- a/gnomemusic/grilo.py
+++ b/gnomemusic/grilo.py
@@ -62,6 +62,7 @@ class Grilo(GObject.GObject):
         Grl.METADATA_KEY_DURATION,
         Grl.METADATA_KEY_FAVOURITE,
         Grl.METADATA_KEY_ID,
+        Grl.METADATA_KEY_LAST_PLAYED,
         Grl.METADATA_KEY_LYRICS,
         Grl.METADATA_KEY_PLAY_COUNT,
         Grl.METADATA_KEY_THUMBNAIL,
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index cf254641..227c5f16 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -199,6 +199,7 @@ class Query():
         nie:title(nmm:musicAlbum(?song)) AS ?album
         nfo:duration(?song) AS ?duration
         ?tag AS ?favourite
+        nie:contentAccessed(?song) AS ?last_played_time
         nie:usageCounter(?song) AS ?play_count
     {
         %(where_clause)s
@@ -261,6 +262,7 @@ class Query():
         nmm:trackNumber(?song) AS ?track_number
         nmm:setNumber(nmm:musicAlbumDisc(?song)) AS ?album_disc_number
         ?tag AS ?favourite
+        nie:contentAccessed(?song) AS ?last_played_time
         nie:usageCounter(?song) AS ?play_count
     WHERE {
         ?song a nmm:MusicPiece ;
@@ -295,6 +297,7 @@ class Query():
         nie:title(nmm:musicAlbum(?song)) AS ?album
         nfo:duration(?song) AS ?duration
         ?tag AS ?favourite
+        nie:contentAccessed(?song) AS ?last_played_time
         nie:usageCounter(?song) AS ?play_count
     WHERE {
         ?playlist a nmm:Playlist ;


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