diff options
author | Max Kellermann <max@duempel.org> | 2014-02-07 18:38:16 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-07 18:44:47 +0100 |
commit | 4ab4cf8532c3231ab1aedddb4cf5a6887c14cd78 (patch) | |
tree | dc2d1a75069e5253463a760d0c84319e3e9759fa /src | |
parent | 3341b282b7e7b22f9130f25d7a67d454b6feef8e (diff) | |
download | mpd-4ab4cf8532c3231ab1aedddb4cf5a6887c14cd78.tar.gz mpd-4ab4cf8532c3231ab1aedddb4cf5a6887c14cd78.tar.xz mpd-4ab4cf8532c3231ab1aedddb4cf5a6887c14cd78.zip |
SongUpdate: pass Storage to UpdateFileInArchive()
Diffstat (limited to '')
-rw-r--r-- | src/SongUpdate.cxx | 9 | ||||
-rw-r--r-- | src/db/Song.hxx | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx index 8990d83c0..9c74618e5 100644 --- a/src/SongUpdate.cxx +++ b/src/SongUpdate.cxx @@ -25,7 +25,6 @@ #include "storage/FileInfo.hxx" #include "util/UriUtil.hxx" #include "util/Error.hxx" -#include "Mapper.hxx" #include "fs/AllocatedPath.hxx" #include "fs/Traits.hxx" #include "fs/FileSystem.hxx" @@ -54,7 +53,7 @@ Song::LoadFile(Storage &storage, const char *path_utf8, Directory &parent) //in archive ? bool success = parent.device == DEVICE_INARCHIVE - ? song->UpdateFileInArchive() + ? song->UpdateFileInArchive(storage) : song->UpdateFile(storage); if (!success) { song->Free(); @@ -115,7 +114,7 @@ Song::UpdateFile(Storage &storage) } bool -Song::UpdateFileInArchive() +Song::UpdateFileInArchive(const Storage &storage) { /* check if there's a suffix and a plugin */ @@ -126,7 +125,9 @@ Song::UpdateFileInArchive() if (!decoder_plugins_supports_suffix(suffix)) return false; - const auto path_fs = map_song_fs(*this); + const auto path_fs = parent->IsRoot() + ? storage.MapFS(uri) + : storage.MapChildFS(parent->GetPath(), uri); if (path_fs.IsNull()) return false; diff --git a/src/db/Song.hxx b/src/db/Song.hxx index 616a566eb..d73c42e00 100644 --- a/src/db/Song.hxx +++ b/src/db/Song.hxx @@ -98,7 +98,7 @@ struct Song { void Free(); bool UpdateFile(Storage &storage); - bool UpdateFileInArchive(); + bool UpdateFileInArchive(const Storage &storage); /** * Returns the URI of the song in UTF-8 encoding, including its |