From 5e93c05095eff2385f02fa946fdb2e97353b1843 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 11 Nov 2015 19:32:32 +0100 Subject: queue/Playlist: seek methods return bool/Error instead of PlaylistResult --- src/command/PlayerCommands.cxx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/command') diff --git a/src/command/PlayerCommands.cxx b/src/command/PlayerCommands.cxx index b9fc7d578..9cfd58a93 100644 --- a/src/command/PlayerCommands.cxx +++ b/src/command/PlayerCommands.cxx @@ -296,9 +296,10 @@ handle_seek(Client &client, Request args, Response &r) if (!args.Parse(0, song, r) || !args.Parse(1, seek_time, r)) return CommandResult::ERROR; - PlaylistResult result = - client.partition.SeekSongPosition(song, seek_time); - return print_playlist_result(r, result); + Error error; + return client.partition.SeekSongPosition(song, seek_time, error) + ? CommandResult::OK + : print_error(r, error); } CommandResult @@ -311,9 +312,10 @@ handle_seekid(Client &client, Request args, Response &r) if (!args.Parse(1, seek_time, r)) return CommandResult::ERROR; - PlaylistResult result = - client.partition.SeekSongId(id, seek_time); - return print_playlist_result(r, result); + Error error; + return client.partition.SeekSongId(id, seek_time, error) + ? CommandResult::OK + : print_error(r, error); } CommandResult @@ -325,9 +327,10 @@ handle_seekcur(Client &client, Request args, Response &r) if (!ParseCommandArg(r, seek_time, p)) return CommandResult::ERROR; - PlaylistResult result = - client.partition.SeekCurrent(seek_time, relative); - return print_playlist_result(r, result); + Error error; + return client.partition.SeekCurrent(seek_time, relative, error) + ? CommandResult::OK + : print_error(r, error); } CommandResult -- cgit v1.2.3