public function getPlaylists()
{
if (is_array($this->playlists)) {
return $this->playlists;
}
$controller = $this->getController();
if ($controller === null) {
throw new \RuntimeException("No controller found on the current network");
}
$data = $controller->soap("ContentDirectory", "Browse", ["ObjectID" => "SQ:", "BrowseFlag" => "BrowseDirectChildren", "Filter" => "", "StartingIndex" => 0, "RequestedCount" => 100, "SortCriteria" => ""]);
$parser = new XmlParser($data["Result"]);
$playlists = [];
foreach ($parser->getTags("container") as $container) {
$playlists[] = new Playlist($container, $controller);
}
return $this->playlists = $playlists;
}