public function doGet($id) { $tm = new Song($id); $peaks = $tm->getPeaks(); header("Content-Type: application/json"); ob_start("ob_gzhandler"); echo $peaks; }
public function doPost(JsonResponse $response, $track_id, HttpFiles $file) { $track = $file->getOrError("file"); $decoded_name = urldecode($track["name"]); $extension = pathinfo($decoded_name, PATHINFO_EXTENSION); $tm = new Song($track_id); $temp_file = TempFileProvider::generate("upload", ".{$extension}"); error_log(print_r($track, true)); error_log("Old Exists: " . (file_exists($track["tmp_name"]) ? 1 : 0)); move_uploaded_file($track["tmp_name"], $temp_file); error_log("New Exists: " . (file_exists($temp_file) ? 1 : 0)); $response->write($tm->upload($temp_file, $decoded_name)); }
public function doPost(JsonResponse $response, $id) { $song = new Song($id); $song->playingCompleted(); }
public function doGet($id) { $track = new Song($id); $track->preview(); }
public function doPost($id) { $track = new Song($id); $track->incrementSkips(); }
public function doPost(JsonResponse $response, $id) { $track = new Song($id); $track->removeRating(); }
public function doPost(JsonResponse $response, $id, $rating) { $track = new Song($id); $track->setRating($rating); }