From ffd16b55a69a01b906805752acc11e26491138bc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 7 Feb 2014 19:01:06 +0100 Subject: StoragePlugin: add method MapToRelativeUTF8() Replaces map_to_relative_path() from Mapper.cxx. --- src/SongPrint.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/SongPrint.cxx') diff --git a/src/SongPrint.cxx b/src/SongPrint.cxx index b0c9ed0a6..30c248d1e 100644 --- a/src/SongPrint.cxx +++ b/src/SongPrint.cxx @@ -20,10 +20,10 @@ #include "config.h" #include "SongPrint.hxx" #include "db/LightSong.hxx" +#include "storage/StorageInterface.hxx" #include "DetachedSong.hxx" #include "TimePrint.hxx" #include "TagPrint.hxx" -#include "Mapper.hxx" #include "client/Client.hxx" #include "util/UriUtil.hxx" @@ -32,12 +32,20 @@ static void song_print_uri(Client &client, const char *uri) { +#ifdef ENABLE_DATABASE + const Storage *storage = client.GetStorage(); + if (storage != nullptr) { + const char *suffix = storage->MapToRelativeUTF8(uri); + if (suffix != nullptr) + uri = suffix; + } +#endif + const std::string allocated = uri_remove_auth(uri); if (!allocated.empty()) uri = allocated.c_str(); - client_printf(client, "%s%s\n", SONG_FILE, - map_to_relative_path(uri)); + client_printf(client, "%s%s\n", SONG_FILE, uri); } void -- cgit v1.2.3