From 8cd50878f6168d556b006645038544c4f38061da Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 16 Nov 2022 13:36:48 +0100 Subject: mpris: Work-around some players not handling empty TrackId It's unclear what to pass to the SetPosition() method when the application doesn't implement the TrackList interface and so doesn't have TrackId metadata. Export placeholder "/org/mpris/MediaPlayer2/TrackList/NoTrack" in the meanwhile, which we'll ignore in when SetPosition() is called. See https://gitlab.freedesktop.org/mpris/mpris-spec/-/issues/19 Closes: #538 --- src/plugins/mpris/totem-mpris.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/mpris/totem-mpris.c b/src/plugins/mpris/totem-mpris.c index df9396bb1..77e0f8feb 100644 --- a/src/plugins/mpris/totem-mpris.c +++ b/src/plugins/mpris/totem-mpris.c @@ -277,6 +277,11 @@ calculate_metadata (TotemMprisPlugin *pi, "{sv}", "xesam:trackNumber", g_variant_new_uint32 (pi->track_number)); + /* See https://gitlab.freedesktop.org/mpris/mpris-spec/-/issues/19 */ + g_variant_builder_add (builder, + "{sv}", + "mpris:trackid", + g_variant_new_object_path ("/org/mpris/MediaPlayer2/TrackList/NoTrack")); for (i = 0; i < G_N_ELEMENTS (str_metadata); i++) { const char *str; -- cgit v1.2.1