[Xfce4-commits] [panel-plugins/xfce4-pulseaudio-plugin] 01/01: Support string variants for xesam:artist
noreply at xfce.org
noreply at xfce.org
Sun Mar 29 14:07:49 CEST 2020
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-pulseaudio-plugin.
commit b7fbd03bffc60484cbc8cab2f9abf1db7ca8db41
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sun Mar 29 08:07:44 2020 -0400
Support string variants for xesam:artist
---
panel-plugin/pulseaudio-mpris-player.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/panel-plugin/pulseaudio-mpris-player.c b/panel-plugin/pulseaudio-mpris-player.c
index 9ebae4a..0c0b581 100644
--- a/panel-plugin/pulseaudio-mpris-player.c
+++ b/panel-plugin/pulseaudio-mpris-player.c
@@ -172,19 +172,26 @@ pulseaudio_mpris_player_parse_metadata (PulseaudioMprisPlayer *player,
}
else if (0 == g_ascii_strcasecmp (key, "xesam:artist"))
{
- artists = g_variant_dup_strv (value, NULL);
- if (artists != NULL)
+ if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
{
- if (g_strv_length (artists) > 0)
- {
- player->artist = g_strdup (artists[0]);
- }
- else
+ player->artist = g_strdup (g_variant_get_string(value, NULL));
+ }
+ else
+ {
+ artists = g_variant_dup_strv (value, NULL);
+ if (artists != NULL)
{
- player->artist = g_strdup ("");
+ if (g_strv_length (artists) > 0)
+ {
+ player->artist = g_strdup (artists[0]);
+ }
+ else
+ {
+ player->artist = g_strdup ("");
+ }
+
+ g_strfreev (artists);
}
-
- g_strfreev (artists);
}
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list