Commit 2cfe9287 authored by Jean Felder's avatar Jean Felder

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.
parent b3573bfd
......@@ -295,12 +295,8 @@ class MediaPlayer2Service(Server):
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment