Esempio n. 1
0
 public function doGet(JsonResponse $response, $track_id, $artist, $album)
 {
     $scrobbler = new AudioScrobbler();
     $cover = $scrobbler->getAlbumCover($artist, $album);
     if ($cover->nonEmpty()) {
         $response->write(Songs::changeCover($track_id, $cover->get()));
     } else {
         throw new ControllerException("Artwork not found");
     }
 }
Esempio n. 2
0
 public function doGet($token)
 {
     $scrobbler = new AudioScrobbler();
     $scrobbler->login($token);
 }
Esempio n. 3
0
 public function doPost(JsonResponse $response, $id)
 {
     $song = SongDao::getSongUsingId($id);
     $scrobbler = new AudioScrobbler();
     $scrobbler->nowPlaying($song[TSongs::T_TITLE], $song[TSongs::T_ARTIST], $song[TSongs::T_ALBUM]);
 }