From d4fbfb9fcc2527821bf2f7c895d093aab4bc1db7 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Sun, 29 Sep 2024 21:58:42 +0200 Subject: [PATCH] new subcommand "tagtypes available" --- NEWS | 1 + include/mpd/capabilities.h | 13 +++++++++++++ src/capabilities.c | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/NEWS b/NEWS index a0cbdeb..55e9eb2 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ libmpdclient 2.23 (not yet released) - command "playlistlength", "stickertypes", "searchplaylist" - tag "ShowMovement" - new sticker find api + - new subcommand "tagtypes available" * Support open end for mpd_search_add_window libmpdclient 2.22 (2023/12/22) diff --git a/include/mpd/capabilities.h b/include/mpd/capabilities.h index cbabc7b..eecc456 100644 --- a/include/mpd/capabilities.h +++ b/include/mpd/capabilities.h @@ -97,6 +97,19 @@ mpd_recv_url_scheme_pair(struct mpd_connection *connection) bool mpd_send_list_tag_types(struct mpd_connection *connection); +/** + * Requests a list of available tag types. This are the tags enabled in + * the configuration. Use mpd_recv_tag_type_pair() to obtain the list + * of "tagtype" pairs. + * + * @param connection the connection to MPD + * @return true on success, false on error + * + * @since libmpdclient 2.23, MPD 0.24 + */ +bool +mpd_send_list_tag_types_available(struct mpd_connection *connection); + /** * Receives the next tag type name. Call this in a loop after * mpd_send_list_tag_types(). diff --git a/src/capabilities.c b/src/capabilities.c index f91e8a5..53d9942 100644 --- a/src/capabilities.c +++ b/src/capabilities.c @@ -35,6 +35,12 @@ mpd_send_list_tag_types(struct mpd_connection *connection) return mpd_send_command(connection, "tagtypes", NULL); } +bool +mpd_send_list_tag_types_available(struct mpd_connection *connection) +{ + return mpd_send_command(connection, "tagtypes", "available", NULL); +} + static bool mpd_send_tag_types_v(struct mpd_connection *connection, const char *sub_command,