Skip to content

Commit

Permalink
Use albumArtist for the tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmetana committed Sep 19, 2019
1 parent 0dad591 commit 2793099
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static void update_metadata(proxy_metadata_t *metadata, GVariant *data_dict)
metadata->disc_number = metadata_get_int("xesam:discNumber", data_dict);
metadata->artist_num = metadata_dup_string_array("xesam:artist",
data_dict, &metadata->artist);
metadata->album_artist_num = metadata_dup_string_array("xesam:artist",
metadata->album_artist_num = metadata_dup_string_array("xesam:albumArtist",
data_dict, &metadata->album_artist);
}

Expand Down
5 changes: 4 additions & 1 deletion src/tray_status_icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,20 @@ gboolean on_tooltip_query(GtkStatusIcon *status_icon, gint x, gint y,
{
proxy_t *proxy = PROXY_T(user_data);
gchar *tooltip_text, *tooltip_title, *tooltip_artist, *tooltip_album;
gchar *artist_str;

if (!proxy->metadata || !proxy->metadata->artist) {
return FALSE;
}
tooltip_title = g_markup_escape_text(proxy->metadata->title, -1);
tooltip_artist = g_markup_escape_text(proxy->metadata->artist[0], -1);
artist_str = g_strjoinv(", ", proxy->metadata->album_artist);
tooltip_artist = g_markup_escape_text(artist_str, -1);
tooltip_album = g_markup_escape_text(proxy->metadata->album, -1);
tooltip_text = g_strdup_printf("<b>%s</b>\n%s - %s",
tooltip_title, tooltip_artist, tooltip_album);
gtk_tooltip_set_markup(tooltip, tooltip_text);
g_free(tooltip_text);
g_free(artist_str);
g_free(tooltip_title);
g_free(tooltip_artist);
g_free(tooltip_album);
Expand Down

0 comments on commit 2793099

Please sign in to comment.