summaryrefslogtreecommitdiff
path: root/app/Anime.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Anime.php')
-rw-r--r--app/Anime.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/app/Anime.php b/app/Anime.php
index 08c0dd1..2c2e57d 100644
--- a/app/Anime.php
+++ b/app/Anime.php
@@ -26,7 +26,9 @@ class Anime extends Model {
'anime_type',
'broadcasted',
'episodes',
- 'airing_status'
+ 'airing_status',
+ 'season_year',
+ 'season_name'
];
public function __construct() {
@@ -73,6 +75,18 @@ class Anime extends Model {
$this->episodes = $animeInfo->getEpisodes();
$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() );
+
+ $this->season_name = $tmp_date["name"];
+ $this->season_year = $tmp_date["year"];
+ }
+ } else {
+ $this->season_name = explode(" ", $this->getPremiered())[0];
+ $this->season_year = explode(" ", $this->getPremiered())[1];
+ }
}
public function getStats() {