aboutsummaryrefslogtreecommitdiff
path: root/src/PlaylistSong.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-03 00:30:15 +0100
committerMax Kellermann <max@duempel.org>2013-01-03 00:37:18 +0100
commitb4b0b34e5a131f02f723f40cf9566cc43e37cf85 (patch)
treec2afa49fe0b8f879a4c0c393e36916fde3c8ea8a /src/PlaylistSong.cxx
parentfa3d1156a6bdbb8fab2a90e1716a1f152f7e8104 (diff)
database.h: eliminate db_*_song()
Use the C++ API.
Diffstat (limited to 'src/PlaylistSong.cxx')
-rw-r--r--src/PlaylistSong.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/PlaylistSong.cxx b/src/PlaylistSong.cxx
index 72d2760c..6bdb164f 100644
--- a/src/PlaylistSong.cxx
+++ b/src/PlaylistSong.cxx
@@ -20,9 +20,10 @@
#include "config.h"
#include "PlaylistSong.hxx"
#include "Mapper.hxx"
+#include "DatabasePlugin.hxx"
+#include "DatabaseGlue.hxx"
extern "C" {
-#include "database.h"
#include "song.h"
#include "uri.h"
#include "path.h"
@@ -105,13 +106,17 @@ playlist_check_load_song(const struct song *song, const char *uri, bool secure)
if (dest == NULL)
return NULL;
} else {
- struct song *tmp = db_get_song(uri);
+ const Database *db = GetDatabase(nullptr);
+ if (db == nullptr)
+ return nullptr;
+
+ struct song *tmp = db->GetSong(uri, nullptr);
if (tmp == NULL)
/* not found in database */
return NULL;
dest = song_dup_detached(tmp);
- db_return_song(tmp);
+ db->ReturnSong(tmp);
}
return apply_song_metadata(dest, song);