示例#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);
 }