aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistFile.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-03 23:30:34 +0100
committerMax Kellermann <max@duempel.org>2014-02-03 23:50:19 +0100
commitb9c248e7e7a451aa8aa2718323abd02a73d3dab5 (patch)
treee4cf7e376b7e8147b81532fc9b1c396061a0c3a1 /src/PlaylistFile.cxx
parentd533b59ee33f13df854b0adb2588ab03bcaedfff (diff)
downloadmpd-b9c248e7e7a451aa8aa2718323abd02a73d3dab5.tar.gz
mpd-b9c248e7e7a451aa8aa2718323abd02a73d3dab5.tar.xz
mpd-b9c248e7e7a451aa8aa2718323abd02a73d3dab5.zip
PlaylistFile: use class SongLoader
Diffstat (limited to 'src/PlaylistFile.cxx')
-rw-r--r--src/PlaylistFile.cxx27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx
index 11d5fc302..a729ac8a0 100644
--- a/src/PlaylistFile.cxx
+++ b/src/PlaylistFile.cxx
@@ -22,8 +22,8 @@
#include "PlaylistSave.hxx"
#include "db/PlaylistInfo.hxx"
#include "db/PlaylistVector.hxx"
-#include "db/DatabaseSong.hxx"
#include "DetachedSong.hxx"
+#include "SongLoader.hxx"
#include "Mapper.hxx"
#include "fs/TextFile.hxx"
#include "config/ConfigGlobal.hxx"
@@ -402,24 +402,17 @@ spl_append_song(const char *utf8path, const DetachedSong &song, Error &error)
}
bool
-spl_append_uri(const char *utf8file, const char *url, Error &error)
+spl_append_uri(const char *utf8file,
+ const SongLoader &loader, const char *url,
+ Error &error)
{
- if (uri_has_scheme(url)) {
- return spl_append_song(utf8file, DetachedSong(url),
- error);
- } else {
-#ifdef ENABLE_DATABASE
- DetachedSong *song = DatabaseDetachSong(url, error);
- if (song == nullptr)
- return false;
-
- bool success = spl_append_song(utf8file, *song, error);
- delete song;
- return success;
-#else
+ DetachedSong *song = loader.LoadSong(url, error);
+ if (song == nullptr)
return false;
-#endif
- }
+
+ bool success = spl_append_song(utf8file, *song, error);
+ delete song;
+ return success;
}
static bool