aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/DatabasePlaylist.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-07 00:29:07 +0100
committerMax Kellermann <max@duempel.org>2014-02-07 00:42:14 +0100
commitc13810ebaa7075284691eb2add089ba407dfd1ea (patch)
tree1ebeb2104ee4a3e73f49416267aec2e79943821b /src/db/DatabasePlaylist.cxx
parent19a982cf693e660ce296a29a9830f1e94d9f1b4c (diff)
downloadmpd-c13810ebaa7075284691eb2add089ba407dfd1ea.tar.gz
mpd-c13810ebaa7075284691eb2add089ba407dfd1ea.tar.xz
mpd-c13810ebaa7075284691eb2add089ba407dfd1ea.zip
Mapper: move map_song_detach() to db/DatabaseSong.cxx
Use Storage::MapUTF8() internally, don't use global variables.
Diffstat (limited to 'src/db/DatabasePlaylist.cxx')
-rw-r--r--src/db/DatabasePlaylist.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/db/DatabasePlaylist.cxx b/src/db/DatabasePlaylist.cxx
index 814901227..90a7f7b1a 100644
--- a/src/db/DatabasePlaylist.cxx
+++ b/src/db/DatabasePlaylist.cxx
@@ -19,24 +19,26 @@
#include "config.h"
#include "DatabasePlaylist.hxx"
+#include "DatabaseSong.hxx"
#include "Selection.hxx"
#include "PlaylistFile.hxx"
#include "DatabasePlugin.hxx"
#include "DetachedSong.hxx"
-#include "Mapper.hxx"
+#include "storage/StorageInterface.hxx"
#include <functional>
static bool
-AddSong(const char *playlist_path_utf8,
+AddSong(const Storage &storage, const char *playlist_path_utf8,
const LightSong &song, Error &error)
{
- return spl_append_song(playlist_path_utf8, map_song_detach(song),
+ return spl_append_song(playlist_path_utf8,
+ DatabaseDetachSong(storage, song),
error);
}
bool
-search_add_to_playlist(const Database &db,
+search_add_to_playlist(const Database &db, const Storage &storage,
const char *uri, const char *playlist_path_utf8,
const SongFilter *filter,
Error &error)
@@ -44,6 +46,7 @@ search_add_to_playlist(const Database &db,
const DatabaseSelection selection(uri, true, filter);
using namespace std::placeholders;
- const auto f = std::bind(AddSong, playlist_path_utf8, _1, _2);
+ const auto f = std::bind(AddSong, std::ref(storage),
+ playlist_path_utf8, _1, _2);
return db.Visit(selection, f, error);
}