diff options
Diffstat (limited to 'src/PlaylistFile.cxx')
-rw-r--r-- | src/PlaylistFile.cxx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx index d4e357a45..2707bcb76 100644 --- a/src/PlaylistFile.cxx +++ b/src/PlaylistFile.cxx @@ -22,8 +22,7 @@ #include "PlaylistSave.hxx" #include "PlaylistInfo.hxx" #include "PlaylistVector.hxx" -#include "DatabasePlugin.hxx" -#include "DatabaseGlue.hxx" +#include "DatabaseSong.hxx" #include "DetachedSong.hxx" #include "Mapper.hxx" #include "fs/TextFile.hxx" @@ -405,18 +404,13 @@ spl_append_uri(const char *url, const char *utf8file, Error &error) return spl_append_song(utf8file, DetachedSong(url), error); } else { - const Database *db = GetDatabase(error); - if (db == nullptr) + DetachedSong *song = DatabaseDetachSong(url, error); + if (song == nullptr) return false; - Song *tmp = db->GetSong(url, error); - if (tmp == nullptr) - return false; - - const DetachedSong song(*tmp); - db->ReturnSong(tmp); - - return spl_append_song(utf8file, song, error); + bool success = spl_append_song(utf8file, *song, error); + delete song; + return success; } } |