aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/PlaylistCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-02 14:37:52 +0100
committerMax Kellermann <max@duempel.org>2014-02-03 23:32:10 +0100
commitca36ac2ba196ee2bbe4b54ee9a71d49174803277 (patch)
treed365b1ac7872e1785befdcebf254885c1c27a268 /src/command/PlaylistCommands.cxx
parentba675d6a55769a6e82a6efaa2f4a812a4eea2362 (diff)
downloadmpd-ca36ac2ba196ee2bbe4b54ee9a71d49174803277.tar.gz
mpd-ca36ac2ba196ee2bbe4b54ee9a71d49174803277.tar.xz
mpd-ca36ac2ba196ee2bbe4b54ee9a71d49174803277.zip
SongLoader: new class that merges duplicate code
There was quite a lot of duplicate code for loading DetachedSong objects, with different semantics for "securely" loading local files.
Diffstat (limited to 'src/command/PlaylistCommands.cxx')
-rw-r--r--src/command/PlaylistCommands.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/command/PlaylistCommands.cxx b/src/command/PlaylistCommands.cxx
index 272fb0ee4..c3c4fe37c 100644
--- a/src/command/PlaylistCommands.cxx
+++ b/src/command/PlaylistCommands.cxx
@@ -25,6 +25,7 @@
#include "PlaylistSave.hxx"
#include "PlaylistFile.hxx"
#include "db/PlaylistVector.hxx"
+#include "SongLoader.hxx"
#include "playlist/PlaylistQueue.hxx"
#include "playlist/Print.hxx"
#include "TimePrint.hxx"
@@ -65,11 +66,12 @@ handle_load(Client &client, int argc, char *argv[])
} else if (!check_range(client, &start_index, &end_index, argv[2]))
return CommandResult::ERROR;
+ const SongLoader loader(client);
const PlaylistResult result =
playlist_open_into_queue(argv[1],
start_index, end_index,
client.playlist,
- client.player_control, true);
+ client.player_control, loader);
if (result != PlaylistResult::NO_SUCH_LIST)
return print_playlist_result(client, result);