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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user