From 285bcbcfafa6c8a3f378b756ff42adb263c438f0 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 11 Apr 2013 09:23:17 +0200 Subject: [PATCH] strfsong: Add fallback mpd tags for more compatibility --- src/strfsong.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/strfsong.c b/src/strfsong.c index 4856767..00bcd87 100644 --- a/src/strfsong.c +++ b/src/strfsong.c @@ -206,17 +206,24 @@ _strfsong(gchar *s, n--; else if (strncmp("%file%", p, n) == 0) temp = utf8_to_locale(mpd_song_get_uri(song)); - else if (strncmp("%artist%", p, n) == 0) + else if (strncmp("%artist%", p, n) == 0) { temp = song_tag_locale(song, MPD_TAG_ARTIST); - else if (strncmp("%albumartist", p, n) == 0) + if (temp == NULL) { + temp = song_tag_locale(song, MPD_TAG_PERFORMER); + if (temp == NULL) + temp = song_tag_locale(song, MPD_TAG_COMPOSER); + } + } else if (strncmp("%albumartist", p, n) == 0) temp = song_tag_locale(song, MPD_TAG_ALBUM_ARTIST); else if (strncmp("%composer%", p, n) == 0) temp = song_tag_locale(song, MPD_TAG_COMPOSER); else if (strncmp("%performer%", p, n) == 0) temp = song_tag_locale(song, MPD_TAG_PERFORMER); - else if (strncmp("%title%", p, n) == 0) + else if (strncmp("%title%", p, n) == 0) { temp = song_tag_locale(song, MPD_TAG_TITLE); - else if (strncmp("%album%", p, n) == 0) + if (temp == NULL) + temp = song_tag_locale(song, MPD_TAG_NAME); + } else if (strncmp("%album%", p, n) == 0) temp = song_tag_locale(song, MPD_TAG_ALBUM); else if (strncmp("%shortalbum%", p, n) == 0) { temp = song_tag_locale(song, MPD_TAG_ALBUM); -- 2.30.2