From 2d52783a9a640b893d559425af20277a6f5d1389 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 18 Aug 2016 11:52:44 +0200 Subject: [PATCH] strfsong: implement "%disc%" https://bugs.musicpd.org/view.php?id=4479 --- NEWS | 1 + doc/ncmpc.1 | 4 +++- src/strfsong.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) 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) -- 2.30.2