From 8d06a993613f408a90be61adc88edd45e2fb2985 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonathan=20Neusch=C3=A4fer?= Date: Fri, 10 Aug 2012 13:21:37 +0200 Subject: [PATCH] strfsong: add %albumartist%, %composer%, and %performer% --- doc/ncmpc.1 | 2 +- src/strfsong.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/ncmpc.1 b/doc/ncmpc.1 index b6eef5e..28f88f5 100644 --- a/doc/ncmpc.1 +++ b/doc/ncmpc.1 @@ -246,7 +246,7 @@ You can view ncmpc's key bindings by pressing '1' (help) when ncmpc is running. To edit key bindings press 'K' and use the key editor in ncmpc. .SH "SONG FORMAT" Format of song display for status and the list window. -The metadata delimiters are: %artist%, %title%, %album%, %shortalbum%, %track%, %genre%, %name%, %time%, %date%, %file%, %shortfile%. +The metadata delimiters are: %artist%, %albumartist%, %composer%, %performer%, %title%, %album%, %shortalbum%, %track%, %genre%, %name%, %time%, %date%, %file%, %shortfile%. The [] operators are used to group output such that if none of the metadata delimiters between '[' and ']' are matched, then none of the characters between '[' and ']' are output; literal text is always output. '&' and '|' are logical operators for AND and OR. '#' is used to escape characters. diff --git a/src/strfsong.c b/src/strfsong.c index 35086e8..4856767 100644 --- a/src/strfsong.c +++ b/src/strfsong.c @@ -208,6 +208,12 @@ _strfsong(gchar *s, temp = utf8_to_locale(mpd_song_get_uri(song)); else if (strncmp("%artist%", p, n) == 0) temp = song_tag_locale(song, MPD_TAG_ARTIST); + 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) temp = song_tag_locale(song, MPD_TAG_TITLE); else if (strncmp("%album%", p, n) == 0) -- 2.30.2