From d10c4fd7538e6af8a5b0eb232a06522fe8c4bf8e Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Mon, 28 Aug 2023 14:01:33 +0000 Subject: [PATCH] fix(premium-podcasts): show premium flag only when podcast has published premium episodes --- app/Models/EpisodeModel.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Models/EpisodeModel.php b/app/Models/EpisodeModel.php index bde68905..aceddab8 100644 --- a/app/Models/EpisodeModel.php +++ b/app/Models/EpisodeModel.php @@ -471,7 +471,9 @@ class EpisodeModel extends UuidModel ->where([ 'podcast_id' => $podcastId, 'is_premium' => true, - ])->countAllResults() > 0; + ]) + ->where('`published_at` <= UTC_TIMESTAMP()', null, false) + ->countAllResults() > 0; } public function fullTextSearch(string $query): ?BaseBuilder