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"); } }
public function doGet($token) { $scrobbler = new AudioScrobbler(); $scrobbler->login($token); }
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]); }