diff --git a/lib/Controller/EpisodesController.php b/lib/Controller/EpisodesController.php index 74597b5..088ff83 100644 --- a/lib/Controller/EpisodesController.php +++ b/lib/Controller/EpisodesController.php @@ -34,7 +34,7 @@ class EpisodesController extends Controller $episodes = $this->episodeActionReader->parseRssXml((string) $feed->getBody()); usort($episodes, fn (EpisodeActionExtraData $a, EpisodeActionExtraData $b) => $b->getPubDate() <=> $a->getPubDate()); - $episodes = array_intersect_key($episodes, array_unique(array_map(fn (EpisodeActionExtraData $episode) => $episode->getGuid(), $episodes))); + $episodes = array_values(array_intersect_key($episodes, array_unique(array_map(fn (EpisodeActionExtraData $episode) => $episode->getGuid(), $episodes)))); return new JSONResponse($episodes, $feed->getStatusCode()); } diff --git a/lib/Controller/SearchController.php b/lib/Controller/SearchController.php index dac90f2..3c808c3 100644 --- a/lib/Controller/SearchController.php +++ b/lib/Controller/SearchController.php @@ -37,7 +37,7 @@ class SearchController extends Controller } usort($podcasts, fn (PodcastData $a, PodcastData $b) => $b->getFetchedAtUnix() <=> $a->getFetchedAtUnix()); - $podcasts = array_intersect_key($podcasts, array_unique(array_map(fn (PodcastData $feed) => $feed->getLink(), $podcasts))); + $podcasts = array_values(array_intersect_key($podcasts, array_unique(array_map(fn (PodcastData $feed) => $feed->getLink(), $podcasts)))); return new JSONResponse($podcasts); }