From 9f52367b8606ba236ba326d3e274b19bbfc5f8ce Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Wed, 23 Aug 2023 09:08:13 +0200 Subject: [PATCH] FIx fetch --- lib/Controller/FetchController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Controller/FetchController.php b/lib/Controller/FetchController.php index 8448d93..4c5077b 100644 --- a/lib/Controller/FetchController.php +++ b/lib/Controller/FetchController.php @@ -26,10 +26,10 @@ class FetchController extends Controller public function index(string $url): JSONResponse { - $podcastData = $this->podcastDataReader->getCachedOrFetchPodcastData($url, $this->userService->getUserUID()); + $podcasts = $this->podcastDataReader->getCachedOrFetchPodcastData($url, $this->userService->getUserUID()); - if ($podcastData) { - return new JSONResponse(['data' => $podcastData->toArray()]); + if ($podcasts) { + return new JSONResponse(['data' => $podcasts]); } $client = $this->clientService->newClient(); @@ -40,8 +40,8 @@ class FetchController extends Controller throw new \ErrorException("Web request returned non-2xx status code: {$statusCode}"); } - $podcastData = PodcastData::parseRssXml((string) $feed->getBody()); + $podcasts = PodcastData::parseRssXml((string) $feed->getBody()); - return new JSONResponse(['data' => $podcastData->toArray()]); + return new JSONResponse(['data' => $podcasts]); } }