[gnome-music/wip/jfelder/mpris-cleanup: 4/29] mpris: Use song favourite status to describe userRating
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/mpris-cleanup: 4/29] mpris: Use song favourite status to describe userRating
- Date: Mon, 8 Apr 2019 16:28:06 +0000 (UTC)
commit a3cf5492c191482eb540183fce06a638bdfb6c34
Author: Jean Felder <jfelder src gnome org>
Date: Tue Sep 4 18:32:35 2018 +0200
mpris: Use song favourite status to describe userRating
Music does not handle user ratings but the favourite status can be
used instead.
Set userRating to 1.0 is song is favourite, 0.0 otherwise.
gnomemusic/mpris.py | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 5ca35f34..f7bedd97 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -328,12 +328,8 @@ class MPRIS(DBusInterface):
except:
pass
- try:
- userRating = media.get_rating()
- assert userRating is not None
- metadata['xesam:userRating'] = GLib.Variant('d', userRating)
- except:
- pass
+ user_rating = 1.0 if media.get_favourite() else 0.0
+ metadata['xesam:userRating'] = GLib.Variant('d', user_rating)
try:
title = utils.get_media_title(media)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]