예제 #1
0
 public function doGet($id)
 {
     $tm = new Song($id);
     $peaks = $tm->getPeaks();
     header("Content-Type: application/json");
     ob_start("ob_gzhandler");
     echo $peaks;
 }
예제 #2
0
 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));
 }
예제 #3
0
 public function doPost(JsonResponse $response, $id)
 {
     $song = new Song($id);
     $song->playingCompleted();
 }
예제 #4
0
 public function doGet($id)
 {
     $track = new Song($id);
     $track->preview();
 }
예제 #5
0
 public function doPost($id)
 {
     $track = new Song($id);
     $track->incrementSkips();
 }
예제 #6
0
 public function doPost(JsonResponse $response, $id)
 {
     $track = new Song($id);
     $track->removeRating();
 }
예제 #7
0
 public function doPost(JsonResponse $response, $id, $rating)
 {
     $track = new Song($id);
     $track->setRating($rating);
 }