From: Jari Vetoniemi Date: Thu, 11 Apr 2013 07:23:17 +0000 (+0200) Subject: strfsong: Add fallback mpd tags for more compatibility X-Git-Tag: release-0.21~6 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=285bcbcfafa6c8a3f378b756ff42adb263c438f0;p=ncmpc.git strfsong: Add fallback mpd tags for more compatibility --- 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);