public function removeTracks(array $positions)
{
$ranges = [];
$key = 0;
$last = -1;
sort($positions);
foreach ($positions as $position) {
$position++;
if ($last > -1) {
if ($position === $last + 1) {
$ranges[$key]++;
$last = $position;
continue;
}
}
$key = $position;
$ranges[$key] = 1;
$last = $position;
}
$offset = 0;
foreach ($ranges as $position => $limit) {
$position -= $offset;
$data = $this->soap("AVTransport", "RemoveTrackRangeFromQueue", ["UpdateID" => $this->getUpdateID(), "StartingIndex" => $position, "NumberOfTracks" => $limit]);
$this->updateId = $data;
$offset += $limit;
}
return true;
}