From 32ec6723115e9d534e3af685ea083bf74da5483d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 15 Jan 2014 18:25:58 +0100 Subject: DatabaseSong: new library merging duplicate code --- src/PlaylistSong.cxx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/PlaylistSong.cxx') diff --git a/src/PlaylistSong.cxx b/src/PlaylistSong.cxx index 4fbfb65a4..5d61c7f71 100644 --- a/src/PlaylistSong.cxx +++ b/src/PlaylistSong.cxx @@ -20,8 +20,7 @@ #include "config.h" #include "PlaylistSong.hxx" #include "Mapper.hxx" -#include "DatabasePlugin.hxx" -#include "DatabaseGlue.hxx" +#include "DatabaseSong.hxx" #include "ls.hxx" #include "tag/Tag.hxx" #include "tag/TagBuilder.hxx" @@ -106,17 +105,9 @@ playlist_check_load_song(const DetachedSong *song, const char *uri, bool secure) return nullptr; } } else { - const Database *db = GetDatabase(); - if (db == nullptr) + dest = DatabaseDetachSong(uri, IgnoreError()); + if (dest == nullptr) return nullptr; - - Song *tmp = db->GetSong(uri, IgnoreError()); - if (tmp == nullptr) - /* not found in database */ - return nullptr; - - dest = new DetachedSong(*tmp); - db->ReturnSong(tmp); } return apply_song_metadata(dest, song); -- cgit v1.2.3