strfsong: remove fallback tags
authorMax Kellermann <max@musicpd.org>
Wed, 26 Sep 2018 10:11:53 +0000 (12:11 +0200)
committerMax Kellermann <max@musicpd.org>
Wed, 26 Sep 2018 10:13:46 +0000 (12:13 +0200)
These were added in commit 285bcbcfafa6c8a3f378b756ff42adb263c438f0,
but I think they should rather be implemented in the configuration
file.  For this reason, the new defaults reflect the old behavior.

doc/config.sample
src/defaults.hxx
src/strfsong.cxx

index 64fb792..a11741f 100644 (file)
 
 ## list-format
 ## The format used to display songs in the main window.
-#list-format = "%name%|[%artist% - ]%title%|%file%"
+#list-format = "%name%|[[%artist%|%performer%|%composer%] - ][%title%|%shortfile%]"
 
 ## The format used to display songs in the search window.
-#search-format = "%name%|[%artist% - ]%title%|%file%"
+#search-format = "%name%|[[%artist%|%performer%|%composer%] - ][%title%|%shortfile%]"
 
 ## The format used to display songs on the status line.
-#status-format = "[%artist% - ]%title%|%shortfile%"
+#status-format = "[[%artist%|%performer%|%composer%] - ][%title%|%shortfile%]"
 
 ## The time, in seconds, for which status messages will be displayed.
 #status-message-time = 3
@@ -99,7 +99,7 @@
 #set-xterm-title = no
 
 ## The format used to for the xterm title when ncmpc is playing.
-#xterm-title-format = "ncmpc: [ %name%|[%artist% - ]%title%|%file%]"
+#xterm-title-format = "ncmpc: [%name%|[[%artist%|%performer%|%composer%] - ][%title%|%shortfile%]]"
 
 ## Automatically save the lyrics after receiving them.
 #lyrics-autosave = no
index 91d99fc..dedca3a 100644 (file)
 #define DEFAULT_SCREEN_LIST {"playlist", "browse"}
 
 /* song format - list window */
-#define DEFAULT_LIST_FORMAT "%name%|[%artist% - ][%title%|%shortfile%]"
+#define DEFAULT_LIST_FORMAT "%name%|[[%artist%|%performer%|%composer%] - ][%title%|%shortfile%]"
 
 /* song format - status window */
-#define DEFAULT_STATUS_FORMAT "[%artist% - ][%title%|%shortfile%]"
+#define DEFAULT_STATUS_FORMAT "[[%artist%|%performer%|%composer%] - ][%title%|%shortfile%]"
 
 #define DEFAULT_LYRICS_TIMEOUT 100
 
index d82753e..46c0f41 100644 (file)
@@ -204,11 +204,6 @@ _strfsong(char *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);
-                       if (temp == nullptr) {
-                               temp = song_tag_locale(song, MPD_TAG_PERFORMER);
-                               if (temp == nullptr)
-                                       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)
@@ -217,8 +212,6 @@ _strfsong(char *s,
                        temp = song_tag_locale(song, MPD_TAG_PERFORMER);
                else if (strncmp("%title%", p, n) == 0) {
                        temp = song_tag_locale(song, MPD_TAG_TITLE);
-                       if (temp == nullptr)
-                               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) {