From ca36ac2ba196ee2bbe4b54ee9a71d49174803277 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 2 Feb 2014 14:37:52 +0100 Subject: 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. --- src/Partition.hxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/Partition.hxx') diff --git a/src/Partition.hxx b/src/Partition.hxx index de41162f3..57dc9a5f4 100644 --- a/src/Partition.hxx +++ b/src/Partition.hxx @@ -26,6 +26,7 @@ struct Instance; class MultipleOutputs; +class SongLoader; /** * A partition of the Music Player Daemon. It is a separate unit with @@ -51,14 +52,10 @@ struct Partition { playlist.Clear(pc); } - PlaylistResult AppendFile(const char *path_utf8, - unsigned *added_id=nullptr) { - return playlist.AppendFile(pc, path_utf8, added_id); - } - - PlaylistResult AppendURI(const char *uri_utf8, + PlaylistResult AppendURI(const SongLoader &loader, + const char *uri_utf8, unsigned *added_id=nullptr) { - return playlist.AppendURI(pc, uri_utf8, added_id); + return playlist.AppendURI(pc, loader, uri_utf8, added_id); } PlaylistResult DeletePosition(unsigned position) { -- cgit v1.2.3