aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistSong.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-15 18:25:58 +0100
committerMax Kellermann <max@duempel.org>2014-01-17 22:58:27 +0100
commit32ec6723115e9d534e3af685ea083bf74da5483d (patch)
tree22c9e08e08f80cda7556c4c2f105b831711085a7 /src/PlaylistSong.cxx
parente2812f722d04ca2f338e00d59d2a649545863b03 (diff)
downloadmpd-32ec6723115e9d534e3af685ea083bf74da5483d.tar.gz
mpd-32ec6723115e9d534e3af685ea083bf74da5483d.tar.xz
mpd-32ec6723115e9d534e3af685ea083bf74da5483d.zip
DatabaseSong: new library merging duplicate code
Diffstat (limited to 'src/PlaylistSong.cxx')
-rw-r--r--src/PlaylistSong.cxx15
1 files changed, 3 insertions, 12 deletions
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);