queue/Playlist: seek methods return bool/Error instead of PlaylistResult
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user