From fd7d251358567612740f9886f28391d62f6a5c0c Mon Sep 17 00:00:00 2001 From: jcorporation Date: Fri, 1 Nov 2024 18:07:06 +0100 Subject: [PATCH] Add "reset" subcommand to tagtypes. This subcommand combines "clear" and "enable" in one command. --- NEWS | 2 +- doc/protocol.rst | 5 +++++ src/command/ClientCommands.cxx | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 5c96a3360..4e5d11826 100644 --- a/NEWS +++ b/NEWS @@ -16,7 +16,7 @@ ver 0.24 (not yet released) - "sticker find" supports sort and window parameter and new sticker compare operators "eq", "lt", "gt", "contains" and "starts_with" - consume only idle flags that were subscribed to - volume command is no longer deprecated - - new "available" subcommand for tagtypes + - new "available" and "reset" subcommands for tagtypes - searching stored playlists respond now with song position * database - attribute "added" shows when each song was added to the database diff --git a/doc/protocol.rst b/doc/protocol.rst index 4885e2285..3c7007f41 100644 --- a/doc/protocol.rst +++ b/doc/protocol.rst @@ -1688,6 +1688,11 @@ Connection settings Shows the list of tag types configured by the ``metadata_to_use`` setting. +:command:`tagtypes reset {NAME...}` + Clear the list of tag types and Re-enable one or more tags + from the list of tag types for this client. These will no + longer be hidden from responses to this client. + .. _command_protocol: :command:`protocol` diff --git a/src/command/ClientCommands.cxx b/src/command/ClientCommands.cxx index 67b4b9bf0..5f0c3b5b6 100644 --- a/src/command/ClientCommands.cxx +++ b/src/command/ClientCommands.cxx @@ -107,6 +107,10 @@ handle_tagtypes(Client &client, Request request, Response &r) } else if (StringIsEqual(cmd, "available")) { tag_print_types_available(r); return CommandResult::OK; + } else if (StringIsEqual(cmd, "reset")) { + client.tag_mask = TagMask::None(); + client.tag_mask |= ParseTagMask(request); + return CommandResult::OK; } else { r.Error(ACK_ERROR_ARG, "Unknown sub command"); return CommandResult::ERROR;