diff options
author | Max Kellermann <max@duempel.org> | 2014-02-07 18:38:10 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-07 18:38:10 +0100 |
commit | 1873c675402cc796ab2b258d8bbf124169cadd97 (patch) | |
tree | 07bd1037b84779afaf8cf283a1f4fcf9845f0dbd /src/command/FileCommands.cxx | |
parent | 8fd8f23a6be0266c80d62f80b21b35b1fb49ae76 (diff) | |
download | mpd-1873c675402cc796ab2b258d8bbf124169cadd97.tar.gz mpd-1873c675402cc796ab2b258d8bbf124169cadd97.tar.xz mpd-1873c675402cc796ab2b258d8bbf124169cadd97.zip |
FileCommands: use Storage::MapFS() instead of map_uri_fs()
Diffstat (limited to '')
-rw-r--r-- | src/command/FileCommands.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx index 709cc3dc0..b8480559c 100644 --- a/src/command/FileCommands.cxx +++ b/src/command/FileCommands.cxx @@ -31,7 +31,7 @@ #include "tag/TagId3.hxx" #include "TagStream.hxx" #include "TagFile.hxx" -#include "Mapper.hxx" +#include "storage/StorageInterface.hxx" #include "fs/AllocatedPath.hxx" #include "ls.hxx" @@ -143,7 +143,16 @@ handle_read_comments(Client &client, gcc_unused int argc, char *argv[]) return read_stream_comments(client, uri); } else if (!PathTraitsUTF8::IsAbsolute(uri)) { #ifdef ENABLE_DATABASE - AllocatedPath path_fs = map_uri_fs(uri); + const Storage *storage = client.GetStorage(); + if (storage == nullptr) { +#endif + command_error(client, ACK_ERROR_NO_EXIST, + "No database"); + return CommandResult::ERROR; +#ifdef ENABLE_DATABASE + } + + AllocatedPath path_fs = storage->MapFS(uri); if (path_fs.IsNull()) { command_error(client, ACK_ERROR_NO_EXIST, "No such file"); @@ -151,9 +160,6 @@ handle_read_comments(Client &client, gcc_unused int argc, char *argv[]) } return read_file_comments(client, path_fs); -#else - command_error(client, ACK_ERROR_NO_EXIST, "No database"); - return CommandResult::ERROR; #endif } else { command_error(client, ACK_ERROR_NO_EXIST, "No such file"); |