From c5a28b8afa68fb5a322383e958a4326b99bd929e Mon Sep 17 00:00:00 2001 From: Eivind Siqveland Date: Sun, 15 Nov 2020 02:00:53 +0100 Subject: [PATCH 1/2] mpris: fix artist name https://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata says artist is a list Fixes the issue for me in Gnome --- sublime_music/dbus/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sublime_music/dbus/manager.py b/sublime_music/dbus/manager.py index 50d85d6..fa50093 100644 --- a/sublime_music/dbus/manager.py +++ b/sublime_music/dbus/manager.py @@ -339,7 +339,7 @@ class DBusManager: # TODO (#71) use walrus once MYPY isn't retarded "xesam:album": (song.album.name if song.album else ""), "xesam:albumArtist": [artist_name], - "xesam:artist": artist_name, + "xesam:artist": [artist_name], "xesam:title": song.title, } From 68bfbaffee8f35f0c05c3aceab818a86fab64780 Mon Sep 17 00:00:00 2001 From: Eivind Siqveland Date: Sun, 15 Nov 2020 02:01:57 +0100 Subject: [PATCH 2/2] mpris: fix covert art According to https://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata artUrl must use scheme 'file://' for local files. Fixes the issue for me in Gnome --- sublime_music/dbus/manager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sublime_music/dbus/manager.py b/sublime_music/dbus/manager.py index fa50093..59ed031 100644 --- a/sublime_music/dbus/manager.py +++ b/sublime_music/dbus/manager.py @@ -328,6 +328,7 @@ class DBusManager: cover_art = AdapterManager.get_cover_art_uri( song.cover_art, "file", allow_download=False ).result() + cover_art = "file://" + cover_art except CacheMissError: cover_art = "" @@ -335,6 +336,8 @@ class DBusManager: return { "mpris:trackid": trackid, "mpris:length": duration, + # Art URIs should be sent as (UTF-8) strings. + # Local files should use the "file://" schema. "mpris:artUrl": cover_art, # TODO (#71) use walrus once MYPY isn't retarded "xesam:album": (song.album.name if song.album else ""),