FileCommands: use Storage::MapFS() instead of map_uri_fs()

This commit is contained in:
Max Kellermann 2014-02-07 18:38:10 +01:00
parent 8fd8f23a6b
commit 1873c67540
1 changed files with 11 additions and 5 deletions

View File

@ -31,7 +31,7 @@
#include "tag/TagId3.hxx" #include "tag/TagId3.hxx"
#include "TagStream.hxx" #include "TagStream.hxx"
#include "TagFile.hxx" #include "TagFile.hxx"
#include "Mapper.hxx" #include "storage/StorageInterface.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "ls.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); return read_stream_comments(client, uri);
} else if (!PathTraitsUTF8::IsAbsolute(uri)) { } else if (!PathTraitsUTF8::IsAbsolute(uri)) {
#ifdef ENABLE_DATABASE #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()) { if (path_fs.IsNull()) {
command_error(client, ACK_ERROR_NO_EXIST, command_error(client, ACK_ERROR_NO_EXIST,
"No such file"); "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); return read_file_comments(client, path_fs);
#else
command_error(client, ACK_ERROR_NO_EXIST, "No database");
return CommandResult::ERROR;
#endif #endif
} else { } else {
command_error(client, ACK_ERROR_NO_EXIST, "No such file"); command_error(client, ACK_ERROR_NO_EXIST, "No such file");