summaryrefslogtreecommitdiff
path: root/src/command
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-03-13 19:37:59 +0100
committerMax Kellermann <max@musicpd.org>2020-03-13 20:01:10 +0100
commit45b60b3d38d80dc8995dfff463ab33e6bfbace3e (patch)
treeea9620ba4a2687adc5720a004e9ed178b101aa33 /src/command
parentcefc773992bcb87feb2874ea4b7a94ba8117ba44 (diff)
fs/Traits: GetParent() returns std::string_view
Diffstat (limited to 'src/command')
-rw-r--r--src/command/FileCommands.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx
index 493b794d0..d8be0da4a 100644
--- a/src/command/FileCommands.cxx
+++ b/src/command/FileCommands.cxx
@@ -169,7 +169,7 @@ handle_read_comments(Client &client, Request args, Response &r)
* opened file or #nullptr on failure.
*/
static InputStreamPtr
-find_stream_art(const char *directory, Mutex &mutex)
+find_stream_art(std::string_view directory, Mutex &mutex)
{
static constexpr char const * art_names[] = {
"cover.png",
@@ -195,11 +195,11 @@ find_stream_art(const char *directory, Mutex &mutex)
static CommandResult
read_stream_art(Response &r, const char *uri, size_t offset)
{
- std::string art_directory = PathTraitsUTF8::GetParent(uri);
+ const auto art_directory = PathTraitsUTF8::GetParent(uri);
Mutex mutex;
- InputStreamPtr is = find_stream_art(art_directory.c_str(), mutex);
+ InputStreamPtr is = find_stream_art(art_directory, mutex);
if (is == nullptr) {
r.Error(ACK_ERROR_NO_EXIST, "No file exists");