aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-07 18:41:42 +0100
committerMax Kellermann <max@duempel.org>2014-02-07 18:41:42 +0100
commitbb3b836dbbd50c8a64aff23e55f5edf487ac6b0f (patch)
tree019957ec5bf4d7472c5c426994560dbf3e8a6a7d /src
parent1873c675402cc796ab2b258d8bbf124169cadd97 (diff)
downloadmpd-bb3b836dbbd50c8a64aff23e55f5edf487ac6b0f.tar.gz
mpd-bb3b836dbbd50c8a64aff23e55f5edf487ac6b0f.tar.xz
mpd-bb3b836dbbd50c8a64aff23e55f5edf487ac6b0f.zip
FileCommands: support remove database files
Diffstat (limited to 'src')
-rw-r--r--src/command/FileCommands.cxx19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx
index b8480559c..e5cc9690f 100644
--- a/src/command/FileCommands.cxx
+++ b/src/command/FileCommands.cxx
@@ -152,14 +152,21 @@ handle_read_comments(Client &client, gcc_unused int argc, char *argv[])
#ifdef ENABLE_DATABASE
}
- AllocatedPath path_fs = storage->MapFS(uri);
- if (path_fs.IsNull()) {
- command_error(client, ACK_ERROR_NO_EXIST,
- "No such file");
- return CommandResult::ERROR;
+ {
+ AllocatedPath path_fs = storage->MapFS(uri);
+ if (!path_fs.IsNull())
+ return read_file_comments(client, path_fs);
}
- return read_file_comments(client, path_fs);
+ {
+ const std::string uri2 = storage->MapUTF8(uri);
+ if (uri_has_scheme(uri2.c_str()))
+ return read_stream_comments(client,
+ uri2.c_str());
+ }
+
+ command_error(client, ACK_ERROR_NO_EXIST, "No such file");
+ return CommandResult::ERROR;
#endif
} else {
command_error(client, ACK_ERROR_NO_EXIST, "No such file");