Merge branch 'mpris-fix-artist' into 'master'

Mpris fix artist

See merge request sublime-music/sublime-music!54
This commit is contained in:
Sumner Evans
2020-11-15 06:03:55 +00:00

View File

@@ -328,6 +328,7 @@ class DBusManager:
cover_art = AdapterManager.get_cover_art_uri( cover_art = AdapterManager.get_cover_art_uri(
song.cover_art, "file", allow_download=False song.cover_art, "file", allow_download=False
).result() ).result()
cover_art = "file://" + cover_art
except CacheMissError: except CacheMissError:
cover_art = "" cover_art = ""
@@ -335,11 +336,13 @@ class DBusManager:
return { return {
"mpris:trackid": trackid, "mpris:trackid": trackid,
"mpris:length": duration, "mpris:length": duration,
# Art URIs should be sent as (UTF-8) strings.
# Local files should use the "file://" schema.
"mpris:artUrl": cover_art, "mpris:artUrl": cover_art,
# TODO (#71) use walrus once MYPY isn't retarded # TODO (#71) use walrus once MYPY isn't retarded
"xesam:album": (song.album.name if song.album else ""), "xesam:album": (song.album.name if song.album else ""),
"xesam:albumArtist": [artist_name], "xesam:albumArtist": [artist_name],
"xesam:artist": artist_name, "xesam:artist": [artist_name],
"xesam:title": song.title, "xesam:title": song.title,
} }