deleteVideo($_POST['videoId']);
     break;
 case 'auth_sub_request':
     generateAuthSubRequestLink();
     break;
 case 'auth_sub_token_upgrade':
     updateAuthSubToken($_GET['token']);
     break;
 case 'clear_session_var':
     clearSessionVar($_POST['name']);
     break;
 case 'retrieve_playlists':
     retrievePlaylists();
     break;
 case 'create_playlist':
     createPlaylist($_POST['playlistTitle'], $_POST['playlistDescription']);
     break;
 case 'delete_playlist':
     deletePlaylist($_POST['playlistTitle']);
     break;
 case 'update_playlist':
     updatePlaylist($_POST['newPlaylistTitle'], $_POST['newPlaylistDescription'], $_POST['oldPlaylistTitle']);
     break;
 case strcmp(substr($operation, 0, 7), 'search_') == 0:
     // initialize search specific information
     $searchType = substr($operation, 7);
     searchVideos($searchType, $_POST['searchTerm'], $_POST['startIndex'], $_POST['maxResults']);
     break;
 case 'show_video':
     echoVideoPlayer($_POST['videoId']);
     break;
예제 #2
0
    switch ($argv[1]) {
        case 'search':
            $settings = new Settings();
            $musicPath = $settings->getSettings('Files', 'music');
            findMusic($musicPath);
            break;
        case 'sync':
            folderToPlaylist();
            break;
    }
}
if (isset($_REQUEST['api']) && checkAPI($_REQUEST['api'], $page_level)) {
    switch ($_SERVER['REQUEST_METHOD']) {
        case 'POST':
            if (isset($_REQUEST['playlist'])) {
                $playlist = createPlaylist($_REQUEST);
                echo json_encode($playlist);
            } else {
                $settings = new Settings();
                $musicPath = $settings->getSettings('Files', 'music');
                findMusic($musicPath);
                http_response_code(202);
            }
            break;
        case 'GET':
            echo json_encode(get($_REQUEST));
            break;
        case 'PUT':
            update($_REQUEST);
            break;
        case 'DELETE':