Commit 3da46481 authored by Max Kellermann's avatar Max Kellermann

command/Player: restore "single" mode using AtScopeExit()

parent 18974094
......@@ -31,6 +31,7 @@
#include "Idle.hxx"
#include "AudioFormat.hxx"
#include "ReplayGainConfig.hxx"
#include "util/ScopeExit.hxx"
#ifdef ENABLE_DATABASE
#include "db/update/Service.hxx"
......@@ -218,12 +219,12 @@ handle_next(Client &client, gcc_unused Request args, gcc_unused Response &r)
const bool single = playlist.queue.single;
playlist.queue.single = false;
Error error;
bool success = client.partition.PlayNext(error);
playlist.queue.single = single;
AtScopeExit(&playlist, single) {
playlist.queue.single = single;
};
return success
Error error;
return client.partition.PlayNext(error)
? CommandResult::OK
: print_error(r, error);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment