From 7a6d0c2efc6293bcdcceb3a06b4bd596c13c2667 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 7 Oct 2021 21:13:27 +0200 Subject: [PATCH] command/Queue: move LookupRemoteTag() to the end Skip the LookupRemoteTag() call if the MoveId() call fails. --- src/command/QueueCommands.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/command/QueueCommands.cxx b/src/command/QueueCommands.cxx index 7844aacaf..c9a8417a4 100644 --- a/src/command/QueueCommands.cxx +++ b/src/command/QueueCommands.cxx @@ -115,7 +115,6 @@ handle_addid(Client &client, Request args, Response &r) auto &partition = client.GetPartition(); const SongLoader loader(client); unsigned added_id = partition.AppendURI(loader, uri); - partition.instance.LookupRemoteTag(uri); if (args.size == 2) { unsigned to = args.ParseUnsigned(1); @@ -129,6 +128,8 @@ handle_addid(Client &client, Request args, Response &r) } } + partition.instance.LookupRemoteTag(uri); + r.Fmt(FMT_STRING("Id: {}\n"), added_id); return CommandResult::OK; }