diff options
author | Max Kellermann <max@duempel.org> | 2013-01-03 00:30:15 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-03 00:37:18 +0100 |
commit | b4b0b34e5a131f02f723f40cf9566cc43e37cf85 (patch) | |
tree | c2afa49fe0b8f879a4c0c393e36916fde3c8ea8a /src/PlaylistFile.cxx | |
parent | fa3d1156a6bdbb8fab2a90e1716a1f152f7e8104 (diff) | |
download | mpd-b4b0b34e5a131f02f723f40cf9566cc43e37cf85.tar.gz mpd-b4b0b34e5a131f02f723f40cf9566cc43e37cf85.tar.xz mpd-b4b0b34e5a131f02f723f40cf9566cc43e37cf85.zip |
database.h: eliminate db_*_song()
Use the C++ API.
Diffstat (limited to 'src/PlaylistFile.cxx')
-rw-r--r-- | src/PlaylistFile.cxx | 17 |
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; } } |