diff --git a/app/Console/Commands/Feed/ReadAndSyncPodcastFeeds.php b/app/Console/Commands/Feed/ReadAndSyncPodcastFeeds.php index 4f3f85dc..de68edb3 100644 --- a/app/Console/Commands/Feed/ReadAndSyncPodcastFeeds.php +++ b/app/Console/Commands/Feed/ReadAndSyncPodcastFeeds.php @@ -6,6 +6,7 @@ use App\Models\Episode; use App\Models\Podcast; use Illuminate\Console\Command; use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Log; class ReadAndSyncPodcastFeeds extends Command { @@ -62,27 +63,30 @@ class ReadAndSyncPodcastFeeds extends Command foreach ($feedIds as $feedId) { $podcast = $client->podcasts->byFeedId($feedId) - ->json(); - $this->info('Importing: '.$podcast->feed->title); + ->json(); + $this->info('Importing: ' . $podcast->feed->title); + if (is_array($podcast->feed)) { + Log::error('Error importing feed: ' . $feedId); + } $importPodcast = Podcast::query() - ->updateOrCreate(['guid' => $podcast->feed->podcastGuid], [ - 'title' => $podcast->feed->title, - 'link' => $podcast->feed->link, - 'language_code' => $podcast->feed->language, - 'data' => $podcast->feed, - 'created_by' => 1, - ]); + ->updateOrCreate(['guid' => $podcast->feed->podcastGuid], [ + 'title' => $podcast->feed->title, + 'link' => $podcast->feed->link, + 'language_code' => $podcast->feed->language, + 'data' => $podcast->feed, + 'created_by' => 1, + ]); $episodes = $client->episodes->withParameters(['max' => 10000]) - ->byFeedId($feedId) - ->json(); + ->byFeedId($feedId) + ->json(); foreach ($episodes->items as $item) { Episode::query() - ->updateOrCreate(['guid' => $item->guid], [ - 'podcast_id' => $importPodcast->id, - 'data' => $item, - 'created_by' => 1, - 'created_at' => Carbon::parse($item->datePublished), - ]); + ->updateOrCreate(['guid' => $item->guid], [ + 'podcast_id' => $importPodcast->id, + 'data' => $item, + 'created_by' => 1, + 'created_at' => Carbon::parse($item->datePublished), + ]); } if (app()->environment('local')) { break; diff --git a/composer.lock b/composer.lock index d36e0750..e4094cc4 100644 --- a/composer.lock +++ b/composer.lock @@ -15328,16 +15328,16 @@ }, { "name": "laravel-lang/http-statuses", - "version": "v3.4.3", + "version": "v3.4.4", "source": { "type": "git", "url": "https://github.com/Laravel-Lang/http-statuses.git", - "reference": "0bd05c814ac28e826bb243b4ab5e1a12fd58e0ce" + "reference": "a040c261c10f68980e865c9900b76c32fd6f0275" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Laravel-Lang/http-statuses/zipball/0bd05c814ac28e826bb243b4ab5e1a12fd58e0ce", - "reference": "0bd05c814ac28e826bb243b4ab5e1a12fd58e0ce", + "url": "https://api.github.com/repos/Laravel-Lang/http-statuses/zipball/a040c261c10f68980e865c9900b76c32fd6f0275", + "reference": "a040c261c10f68980e865c9900b76c32fd6f0275", "shasum": "" }, "require": { @@ -15392,7 +15392,7 @@ ], "support": { "issues": "https://github.com/Laravel-Lang/http-statuses/issues", - "source": "https://github.com/Laravel-Lang/http-statuses/tree/v3.4.3" + "source": "https://github.com/Laravel-Lang/http-statuses/tree/v3.4.4" }, "funding": [ { @@ -15400,7 +15400,7 @@ "type": "open_collective" } ], - "time": "2023-08-22T01:18:47+00:00" + "time": "2023-08-24T01:17:58+00:00" }, { "name": "laravel-lang/lang",