From 0439df05cceb18b6d405d9ecd34cde582b2ec3a6 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Sun, 28 Aug 2022 20:41:09 +0200 Subject: [PATCH] Add playlist_directory to config command response --- doc/protocol.rst | 1 + src/command/OtherCommands.cxx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/doc/protocol.rst b/doc/protocol.rst index 2b55aa124..d73b63761 100644 --- a/doc/protocol.rst +++ b/doc/protocol.rst @@ -1599,6 +1599,7 @@ Reflection The following response attributes are available: - ``music_directory``: The absolute path of the music directory. + - ``playlist_directory``: The absolute path of the playlist directory. .. _command_commands: diff --git a/src/command/OtherCommands.cxx b/src/command/OtherCommands.cxx index 3c7adefa4..1aa151462 100644 --- a/src/command/OtherCommands.cxx +++ b/src/command/OtherCommands.cxx @@ -46,6 +46,7 @@ #include "Instance.hxx" #include "IdleFlags.hxx" #include "Log.hxx" +#include "Mapper.hxx" #ifdef ENABLE_DATABASE #include "DatabaseCommands.hxx" @@ -394,6 +395,10 @@ handle_config(Client &client, [[maybe_unused]] Request args, Response &r) } #endif + const auto spl_path = map_spl_path(); + if (!spl_path.IsNull()) + r.Fmt(FMT_STRING("playlist_directory: {}\n"), spl_path.ToUTF8()); + return CommandResult::OK; }