diff options
author | Max Kellermann <max@duempel.org> | 2014-01-17 23:49:53 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-17 23:49:53 +0100 |
commit | 75b847132afb75d50b3c7041f298fb4372ccd1c2 (patch) | |
tree | e6a3765bd585d2bbdcae3dc244c2d18a8b0f6ad9 /src | |
parent | 32ec6723115e9d534e3af685ea083bf74da5483d (diff) | |
download | mpd-75b847132afb75d50b3c7041f298fb4372ccd1c2.tar.gz mpd-75b847132afb75d50b3c7041f298fb4372ccd1c2.tar.xz mpd-75b847132afb75d50b3c7041f298fb4372ccd1c2.zip |
QueueSave: use DatabaseDetachSong()
Diffstat (limited to '')
-rw-r--r-- | src/QueueSave.cxx | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/QueueSave.cxx b/src/QueueSave.cxx index 30dae37e3..601d3519a 100644 --- a/src/QueueSave.cxx +++ b/src/QueueSave.cxx @@ -23,8 +23,7 @@ #include "PlaylistError.hxx" #include "DetachedSong.hxx" #include "SongSave.hxx" -#include "DatabasePlugin.hxx" -#include "DatabaseGlue.hxx" +#include "DatabaseSong.hxx" #include "fs/TextFile.hxx" #include "util/StringUtil.hxx" #include "util/UriUtil.hxx" @@ -111,16 +110,9 @@ queue_load_song(TextFile &file, const char *line, queue &queue) if (uri_has_scheme(uri)) { song = new DetachedSong(uri); } else { - const Database *db = GetDatabase(); - if (db == nullptr) + song = DatabaseDetachSong(uri, IgnoreError()); + if (song == nullptr) return; - - Song *tmp = db->GetSong(uri, IgnoreError()); - if (tmp == nullptr) - return; - - song = new DetachedSong(*tmp); - db->ReturnSong(tmp); } } |