aboutsummaryrefslogtreecommitdiffstats
path: root/src/SongLoader.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-07 19:01:06 +0100
committerMax Kellermann <max@duempel.org>2014-02-07 19:09:28 +0100
commitffd16b55a69a01b906805752acc11e26491138bc (patch)
treeeae175525c3691e87c348bc107f903e61302cf69 /src/SongLoader.cxx
parentd744c997d8a4370d56901c5bdf92d3cca0ef83bc (diff)
downloadmpd-ffd16b55a69a01b906805752acc11e26491138bc.tar.gz
mpd-ffd16b55a69a01b906805752acc11e26491138bc.tar.xz
mpd-ffd16b55a69a01b906805752acc11e26491138bc.zip
StoragePlugin: add method MapToRelativeUTF8()
Replaces map_to_relative_path() from Mapper.cxx.
Diffstat (limited to 'src/SongLoader.cxx')
-rw-r--r--src/SongLoader.cxx17
1 files changed, 8 insertions, 9 deletions
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) {