summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-03-29 17:01:31 +0100
committerMax Kellermann <max@musicpd.org>2019-03-29 17:01:31 +0100
commit976731ab6cc88b88a71179f9ed4b27cbdc3c54da (patch)
tree9c1f8b6796038300b1ddffccd0995fc88bbd31a4 /src
parent0d8942e64a0e1ef860e31a81246a0d17bbfda075 (diff)
command/playlist: invoke the RemoteTagScanner on all newly added songs
Closes https://github.com/MusicPlayerDaemon/MPD/issues/234
Diffstat (limited to 'src')
-rw-r--r--src/command/PlaylistCommands.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/command/PlaylistCommands.cxx b/src/command/PlaylistCommands.cxx
index 858cd2029..89b64ff6f 100644
--- a/src/command/PlaylistCommands.cxx
+++ b/src/command/PlaylistCommands.cxx
@@ -20,6 +20,7 @@
#include "config.h"
#include "PlaylistCommands.hxx"
#include "Request.hxx"
+#include "Instance.hxx"
#include "db/DatabasePlaylist.hxx"
#include "CommandError.hxx"
#include "PlaylistSave.hxx"
@@ -27,6 +28,7 @@
#include "PlaylistError.hxx"
#include "db/PlaylistVector.hxx"
#include "SongLoader.hxx"
+#include "song/DetachedSong.hxx"
#include "BulkEdit.hxx"
#include "playlist/PlaylistQueue.hxx"
#include "playlist/Print.hxx"
@@ -76,11 +78,21 @@ handle_load(Client &client, Request args, gcc_unused Response &r)
const ScopeBulkEdit bulk_edit(client.GetPartition());
+ auto &playlist = client.GetPlaylist();
+ const unsigned old_size = playlist.GetLength();
+
const SongLoader loader(client);
playlist_open_into_queue(uri,
range.start, range.end,
- client.GetPlaylist(),
+ playlist,
client.GetPlayerControl(), loader);
+
+ /* invoke the RemoteTagScanner on all newly added songs */
+ auto &instance = client.GetInstance();
+ const unsigned new_size = playlist.GetLength();
+ for (unsigned i = old_size; i < new_size; ++i)
+ instance.LookupRemoteTag(playlist.queue.Get(i).GetURI());
+
return CommandResult::OK;
}