From 08e1684fbdcbc53d00be1633be66baa7b9fe01b5 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Sat, 23 Dec 2023 21:51:48 +0100 Subject: [PATCH] Fix existing url --- lib/Core/EpisodeAction/EpisodeActionReader.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Core/EpisodeAction/EpisodeActionReader.php b/lib/Core/EpisodeAction/EpisodeActionReader.php index 0e47787..ecc6dcc 100644 --- a/lib/Core/EpisodeAction/EpisodeActionReader.php +++ b/lib/Core/EpisodeAction/EpisodeActionReader.php @@ -41,7 +41,13 @@ class EpisodeActionReader $episodeFilesize = (int) $item->enclosure['length']; // Get episode action - $episodeAction = $this->episodeActionRepository->findByEpisodeUrl($episodeUrl, $this->userService->getUserUID()); + $episodeAction = $this->episodeActionRepository->findByGuid($episodeGuid, $this->userService->getUserUID()); + + if ($episodeAction) { + $episodeUrl = $episodeAction->getEpisode(); + } else { + $episodeAction = $this->episodeActionRepository->findByEpisodeUrl($episodeUrl, $this->userService->getUserUID()); + } // Get episode name $episodeName = $this->stringOrNull($item->title);