Skip to content

Commit

Permalink
fix(preview): delete episode preview cache after editing episode
Browse files Browse the repository at this point in the history
fixes #514
  • Loading branch information
yassinedoghri committed Aug 14, 2024
1 parent a3fbcc8 commit 6a2cdd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Models/EpisodeModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function getPublishedEpisodeById(int $podcastId, int $episodeId): ?Episod

public function getEpisodeByPreviewId(string $previewId): ?Episode
{
$cacheName = "podcast_episode#preview-{$previewId}";
$cacheName = "podcast_episode-preview#{$previewId}";
if (! ($found = cache($cacheName))) {
$builder = $this->where([
'preview_id' => $this->uuid->fromString($previewId)
Expand Down Expand Up @@ -441,7 +441,7 @@ public function clearCache(array $data): array
cache()
->deleteMatching("podcast-{$episode->podcast->handle}*");
cache()
->delete("podcast_episode#{$episode->id}");
->deleteMatching('podcast_episode*');
cache()
->deleteMatching("page_podcast#{$episode->podcast_id}*");
cache()
Expand Down

0 comments on commit 6a2cdd0

Please sign in to comment.