command/playlist: allow range in playlistdelete

This commit is contained in:
Max Kellermann
2021-10-25 12:16:20 +02:00
parent ade847bc89
commit 48e8a26813
5 changed files with 19 additions and 3 deletions

View File

@@ -175,10 +175,10 @@ handle_playlistdelete([[maybe_unused]] Client &client,
Request args, [[maybe_unused]] Response &r)
{
const char *const name = args[0];
unsigned from = args.ParseUnsigned(1);
const auto range = args.ParseRange(1);
PlaylistFileEditor editor(name, PlaylistFileEditor::LoadMode::YES);
editor.RemoveIndex(from);
editor.RemoveRange(range);
editor.Save();
return CommandResult::OK;
}