From: Max Kellermann Date: Thu, 18 Aug 2016 09:52:44 +0000 (+0200) Subject: strfsong: implement "%disc%" X-Git-Tag: v0.25~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2d52783a9a640b893d559425af20277a6f5d1389;p=ncmpc.git strfsong: implement "%disc%" https://bugs.musicpd.org/view.php?id=4479 --- diff --git a/NEWS b/NEWS index 70cf71b..2d326e7 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ ncmpc 0.25 - not yet released +* implement "%disc%" * lyricswiki: handle redirects * lyricswiki: update XML format diff --git a/doc/ncmpc.1 b/doc/ncmpc.1 index 69e5919..7711963 100644 --- a/doc/ncmpc.1 +++ b/doc/ncmpc.1 @@ -249,7 +249,9 @@ 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%, %albumartist%, %composer%, %performer%, %title%, %album%, %shortalbum%, %track%, %genre%, %name%, %time%, %date%, %file%, %shortfile%. +The metadata delimiters are: %artist%, %albumartist%, %composer%, +%performer%, %title%, %album%, %shortalbum%, %track%, %disc, +%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 5107ba0..2d88d1f 100644 --- a/src/strfsong.c +++ b/src/strfsong.c @@ -232,6 +232,8 @@ _strfsong(gchar *s, } else if (strncmp("%track%", p, n) == 0) temp = song_tag_locale(song, MPD_TAG_TRACK); + else if (strncmp("%disc%", p, n) == 0) + temp = song_tag_locale(song, MPD_TAG_DISC); else if (strncmp("%name%", p, n) == 0) temp = song_tag_locale(song, MPD_TAG_NAME); else if (strncmp("%date%", p, n) == 0)