aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-07 18:38:10 +0100
committerMax Kellermann <max@duempel.org>2014-02-07 18:38:10 +0100
commit1873c675402cc796ab2b258d8bbf124169cadd97 (patch)
tree07bd1037b84779afaf8cf283a1f4fcf9845f0dbd
parent8fd8f23a6be0266c80d62f80b21b35b1fb49ae76 (diff)
downloadmpd-1873c675402cc796ab2b258d8bbf124169cadd97.tar.gz
mpd-1873c675402cc796ab2b258d8bbf124169cadd97.tar.xz
mpd-1873c675402cc796ab2b258d8bbf124169cadd97.zip
FileCommands: use Storage::MapFS() instead of map_uri_fs()
-rw-r--r--src/command/FileCommands.cxx16
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");