print $streams->search($_GET['q']); $streams->print_gzipped_page(); die; } else { if ($_GET['action'] == "clearPlaylist") { print $streams->clearPlaylist(); $streams->print_gzipped_page(); die; } else { if ($_GET['action'] == "addToPlaylist") { print $streams->addToPlaylist($_GET['dir']); $streams->print_gzipped_page(); die; } else { if ($_GET['action'] == "addToPlaylistFile") { print $streams->addToPlaylistFile($_GET['dir'], $_GET['file']); $streams->print_gzipped_page(); die; } else { if ($_GET['action'] == "getRandomPlaylist") { if (isset($_GET['station']) && $_GET['station'] != null && $_GET['station'] != "undefined") { $o = $streams->getRandomPlaylistJson($_GET['num'], "{$auth->userDir}/stations/{$_GET['station']}.files.db"); } else { if (isset($_GET['personal']) && $_GET['personal'] == "yes") { $o = $streams->getRandomPlaylistJson($_GET['num'], "{$auth->userDir}/{$cfg->personalRadioDatabase}"); } else { $o = $streams->getRandomPlaylistJson($_GET['num']); } } print $o; $streams->print_gzipped_page();