diff options
| author | horus | 2020-03-05 22:24:28 +0100 |
|---|---|---|
| committer | horus | 2020-03-05 22:24:36 +0100 |
| commit | 38ad5415db862e24da03ee194ef723540f9848a6 (patch) | |
| tree | 2f9a5bf2f53029bc21c338d9ef865638d69c8454 /app/AnimeStats.php | |
| parent | 095aba3e990afe5b181524e4830dc4d85e9475be (diff) | |
| download | senpai-38ad5415db862e24da03ee194ef723540f9848a6.tar.gz | |
Basic usage implemented.
Diffstat (limited to 'app/AnimeStats.php')
| -rw-r--r-- | app/AnimeStats.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/AnimeStats.php b/app/AnimeStats.php index 827032c..765d24f 100644 --- a/app/AnimeStats.php +++ b/app/AnimeStats.php @@ -94,7 +94,6 @@ class AnimeStats extends Model { $this->season_name= $season_name; } - #$animeInfo = $this->getInfo(); $animeInfo = $jikan->getAnime( (new \Jikan\Request\Anime\AnimeRequest( $this->mal_id )) ); @@ -105,9 +104,15 @@ class AnimeStats extends Model { $this->members = $animeInfo->getMembers(); $this->favorites = $animeInfo->getFavorites(); - $animeStats = $jikan->getAnimeStats( - (new \Jikan\Request\Anime\AnimeStatsRequest( $this->mal_id )) - ); + try { + $animeStats = $jikan->getAnimeStats( + (new \Jikan\Request\Anime\AnimeStatsRequest( $this->mal_id )) + ); + } catch (\Exception $e) { + echo "Error requesting AnimeStats for " . $this->mal_id ."\n"; + echo "Message: " . $e->getMessage(); + echo "\n\n"; + } $this->watching = $animeStats->getWatching(); $this->completed = $animeStats->getCompleted(); |
