[banshee] Mpris: Add xesam:userRating field in track metadata (bgo#665997)



commit 12c2a1b7497376c871eca897d0c1f764b345b151
Author: Olivier Dufour <olivier duff gmail com>
Date:   Sun Jan 8 16:04:03 2012 +0100

    Mpris: Add xesam:userRating field in track metadata (bgo#665997)
    
    Signed-off-by: Bertrand Lorentz <bertrand lorentz gmail com>

 .../Banshee.Mpris/Banshee.Mpris/Metadata.cs        |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/Extensions/Banshee.Mpris/Banshee.Mpris/Metadata.cs b/src/Extensions/Banshee.Mpris/Banshee.Mpris/Metadata.cs
index 33414af..f1377d7 100644
--- a/src/Extensions/Banshee.Mpris/Banshee.Mpris/Metadata.cs
+++ b/src/Extensions/Banshee.Mpris/Banshee.Mpris/Metadata.cs
@@ -79,6 +79,11 @@ namespace Banshee.Mpris
                 SetInfo ("xesam:contentCreated", track.ReleaseDate.ToString ("s"));
             }
 
+            if (track.Rating > 0) {
+                // Scale is 0.0 to 1.0
+                SetInfo ("xesam:userRating", (double)track.Rating / 5);
+            }
+
             string artid = track.ArtworkId;
             if (artid != null) {
                 SetInfo ("mpris:artUrl", String.Concat ("file://", CoverArtSpec.GetPath (artid)));



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