diff options
Diffstat (limited to 'app/Anime.php')
| -rw-r--r-- | app/Anime.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/Anime.php b/app/Anime.php index 81fdee3..4999c1b 100644 --- a/app/Anime.php +++ b/app/Anime.php @@ -34,7 +34,7 @@ class Anime extends Model { public function __construct() { } - public function fill( $id ) { + public function fill( $id, $skip_if_unpopular = true ) { $this->mal_id = $id; $jikan = new Malclient; @@ -49,7 +49,7 @@ class Anime extends Model { echo "\n\n"; } - if ( 10000 > $animeInfo->getMembers() ) { + if ( $skip_if_unpopular && 10000 > $animeInfo->getMembers() ) { echo "Anime (" . $this->mal_id . ") has only " . $animeInfo->getMembers() . " Members. Not worth to keep. Skipping\n"; return; } @@ -76,6 +76,7 @@ class Anime extends Model { $this->airing_status = getAiringStatusCode($animeInfo->getStatus()); + if ( is_null($animeInfo->getPremiered()) ) { if ( env('ANIME_NOT_YET_AIRED') != $this->airing_status ) { $tmp_date = getSeasonFromDate( $animeInfo->getAired()->getFrom() ); @@ -84,8 +85,8 @@ class Anime extends Model { $this->season_year = $tmp_date["year"]; } } else { - $this->season_name = explode(" ", $this->getPremiered())[0]; - $this->season_year = explode(" ", $this->getPremiered())[1]; + $this->season_name = explode(" ", $animeInfo->getPremiered())[0]; + $this->season_year = explode(" ", $animeInfo->getPremiered())[1]; } } |
