From 38843f78bfbd27969df853377696dc8f8c71a921 Mon Sep 17 00:00:00 2001 From: horus Date: Mon, 24 Feb 2020 00:52:12 +0100 Subject: Adds models for score tracking. --- app/Anime.php | 49 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) (limited to 'app/Anime.php') diff --git a/app/Anime.php b/app/Anime.php index b13f785..1e8fb95 100644 --- a/app/Anime.php +++ b/app/Anime.php @@ -1,30 +1,55 @@ id = $id; + + if ( $parse_info ) { + $jikan = new Malclient; + + $this->animeInfo = $jikan->getAnime( + (new \Jikan\Request\Anime\AnimeRequest( $this->id )) + ); + + $this->url = $this->animeInfo->GetUrl(); + $this->image_url = $this->animeInfo->getImageUrl(); + + $this->title_eng = $this->animeInfo->getTitleEnglish(); + $this->title_rom = $this->animeInfo->getTitle(); + $this->title_nat = $this->animeInfo->getTitleJapanese(); + $this->title_pref = $this->animeInfo->getTitle(); + + $this->type = $this->animeInfo->getType(); + } } + + protected function getInfo() { + return $this->animeInfo; + } + } -- cgit v1.2.3