aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistFile.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/PlaylistFile.cxx
parentfa3d1156a6bdbb8fab2a90e1716a1f152f7e8104 (diff)
downloadmpd-b4b0b34e5a131f02f723f40cf9566cc43e37cf85.tar.gz
mpd-b4b0b34e5a131f02f723f40cf9566cc43e37cf85.tar.xz
mpd-b4b0b34e5a131f02f723f40cf9566cc43e37cf85.zip
database.h: eliminate db_*_song()
Use the C++ API.
Diffstat (limited to '')
-rw-r--r--src/PlaylistFile.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx
index 896307df9..7459bd69a 100644
--- a/src/PlaylistFile.cxx
+++ b/src/PlaylistFile.cxx
@@ -20,6 +20,8 @@
#include "config.h"
#include "PlaylistFile.hxx"
#include "PlaylistSave.hxx"
+#include "DatabasePlugin.hxx"
+#include "DatabaseGlue.hxx"
#include "song.h"
#include "io_error.h"
#include "Mapper.hxx"
@@ -28,7 +30,6 @@ extern "C" {
#include "text_file.h"
#include "path.h"
#include "uri.h"
-#include "database.h"
#include "idle.h"
#include "conf.h"
}
@@ -423,16 +424,16 @@ spl_append_uri(const char *url, const char *utf8file, GError **error_r)
song_free(song);
return success;
} else {
- struct song *song = db_get_song(url);
- if (song == NULL) {
- g_set_error_literal(error_r, playlist_quark(),
- PLAYLIST_RESULT_NO_SUCH_SONG,
- "No such song");
+ const Database *db = GetDatabase(error_r);
+ if (db == nullptr)
+ return false;
+
+ song *song = db->GetSong(url, error_r);
+ if (song == nullptr)
return false;
- }
bool success = spl_append_song(utf8file, song, error_r);
- db_return_song(song);
+ db->ReturnSong(song);
return success;
}
}