diff options
| author | horus | 2021-02-11 22:59:45 +0100 |
|---|---|---|
| committer | horus | 2021-02-11 22:59:45 +0100 |
| commit | 5336324116082afa7f9ce2eb94c6ae1fc47760ae (patch) | |
| tree | 101208f41163787e2f3b5800abce6ba8fa3f76ad | |
| parent | 8d73d232ef4fda59205ef1e8d531daeb17c3fbd9 (diff) | |
| download | senpai-5336324116082afa7f9ce2eb94c6ae1fc47760ae.tar.gz | |
Bugfix. Calendar works again.
| -rw-r--r-- | app/Libraries/Background.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/Libraries/Background.php b/app/Libraries/Background.php index 5ec6ef6..794ca02 100644 --- a/app/Libraries/Background.php +++ b/app/Libraries/Background.php @@ -20,6 +20,7 @@ use Eluceo\iCal\Component\Event; class Background { public function saveAiring(Anime $anime) { + echo "saveAiring for " . $anime->mal_id . " | "; if ( $anime->airing_status != env("ANIME_IS_AIRING") ) { echo "saveAiring: Anime (" . $anime->mal_id . ") is not airing. Skipping.\n"; return; @@ -55,8 +56,7 @@ class Background { * Check if we need to save the airing data or if we already have it in database. */ if ( ! is_null( $airing->episode ) ) { - if ( ! is_null( $airing_data->nextAiringEpisode ) && - ( $airing->episode == $airing_data->nextAiringEpisode->episode) ) { + if ( ! is_null( $airing_data->nextAiringEpisode ) ){ if ( $airing->aired_at == Carbon::createFromTimestamp($airing_data->nextAiringEpisode->airingAt) ) { /** * Double entry. @@ -77,6 +77,8 @@ class Background { ->delete(); } } + } else { + echo "Episode data is null. (" . $anime->mal_id . "). | "; } $new_airing = new Airing(); @@ -153,7 +155,6 @@ class Background { $animeStats = new AnimeStats(); if ( $animeStats->fill($entry->mal_id) ) { - # Only save if no error $animeStats->save(); $counter++; |
