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/SongLoader.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/SongLoader.cxx') diff --git a/src/SongLoader.cxx b/src/SongLoader.cxx index f2cf216a7..c766a16a9 100644 --- a/src/SongLoader.cxx +++ b/src/SongLoader.cxx @@ -20,8 +20,8 @@ #include "config.h" #include "SongLoader.hxx" #include "client/Client.hxx" -#include "Mapper.hxx" #include "db/DatabaseSong.hxx" +#include "storage/StorageInterface.hxx" #include "ls.hxx" #include "fs/AllocatedPath.hxx" #include "fs/Traits.hxx" @@ -45,14 +45,13 @@ DetachedSong * SongLoader::LoadFile(const char *path_utf8, Error &error) const { #ifdef ENABLE_DATABASE - /* TODO fs_charset vs utf8? */ - const char *suffix = map_to_relative_path(path_utf8); - assert(suffix != nullptr); - - if (suffix != path_utf8) - /* this path was relative to the music directory - - obtain it from the database */ - return LoadSong(suffix, error); + if (storage != nullptr) { + const char *suffix = storage->MapToRelativeUTF8(path_utf8); + if (suffix != nullptr) + /* this path was relative to the music + directory - obtain it from the database */ + return LoadSong(suffix, error); + } #endif if (client != nullptr) { -- cgit v1.2.3