From 750e7ff59d961ea4606696cae320337b3d6e0b6a Mon Sep 17 00:00:00 2001 From: Lucas Zacharewicz <32346942+Babarbitz@users.noreply.github.com> Date: Sun, 13 Dec 2020 08:02:49 -0500 Subject: [PATCH] Added option to hide album dates (#417) * Added option to hide album dates * Fixed formating typo --- doc/config | 2 ++ doc/ncmpcpp.1 | 3 +++ src/screens/media_library.cpp | 3 ++- src/settings.cpp | 1 + src/settings.h | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/config b/doc/config index fc61a5f0..05a9ac07 100644 --- a/doc/config +++ b/doc/config @@ -339,6 +339,8 @@ # #media_library_albums_split_by_date = yes # +#media_library_hide_album_dates = no +# ## Available values: wrapped, normal. ## #default_find_mode = wrapped diff --git a/doc/ncmpcpp.1 b/doc/ncmpcpp.1 index 8ce98881..2fa8703c 100644 --- a/doc/ncmpcpp.1 +++ b/doc/ncmpcpp.1 @@ -236,6 +236,9 @@ Default tag type for leftmost column in media library. .B media_library_albums_split_by_date = yes/no Determines whether albums in media library should be split by date. .TP +.B media_library_hide_album_dates = yes/no +Determines whether album dates in media library should be hidden. +.TP .B default_find_mode = wrapped/normal If set to "wrapped", going from last found position to next will take you to the first one (same goes for the first position and going to previous one), otherwise no actions will be performed. .TP diff --git a/src/screens/media_library.cpp b/src/screens/media_library.cpp index 9ca0132d..19ce5af5 100644 --- a/src/screens/media_library.cpp +++ b/src/screens/media_library.cpp @@ -1116,7 +1116,8 @@ std::string AlbumToString(const AlbumEntry &ae) result += " - "; } } - if (Config.media_lib_primary_tag != MPD_TAG_DATE && !ae.entry().date().empty() && !isAlbumOnly) + + if (Config.media_lib_primary_tag != MPD_TAG_DATE && !Config.media_lib_hide_album_dates && !ae.entry().date().empty()) result += "(" + ae.entry().date() + ") "; result += ae.entry().album().empty() ? "" : ae.entry().album(); } diff --git a/src/settings.cpp b/src/settings.cpp index 6d323848..45b264bb 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -430,6 +430,7 @@ bool Configuration::read(const std::vector &config_paths, bool igno }); p.add("user_interface", &design, "classic"); p.add("data_fetching_delay", &data_fetching_delay, "yes", yes_no); + p.add("media_library_hide_album_dates", &media_lib_hide_album_dates, "no", yes_no); p.add("media_library_primary_tag", &media_lib_primary_tag, "artist", [](std::string v) { if (v == "artist") return MPD_TAG_ARTIST; diff --git a/src/settings.h b/src/settings.h index 77383754..f31ba748 100644 --- a/src/settings.h +++ b/src/settings.h @@ -168,6 +168,7 @@ struct Configuration bool visualizer_in_stereo; bool data_fetching_delay; bool media_library_sort_by_mtime; + bool media_lib_hide_album_dates; bool tag_editor_extended_numeration; bool discard_colors_if_item_is_selected; bool store_lyrics_in_song_dir;