Loading app/Controllers/EpisodeController.php +13 −4 Original line number Diff line number Diff line Loading @@ -177,10 +177,19 @@ class EpisodeController extends BaseController $session->set('embed_domain', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST)); } $locale = service('request') ->getLocale(); $cacheName = "page_podcast#{$this->podcast->id}_episode#{$this->episode->id}_embed_{$theme}_{$locale}"; $cacheName = implode( '_', array_filter([ 'page', "podcast#{$this->podcast->id}", "episode#{$this->episode->id}", 'embed', $theme, service('request') ->getLocale(), is_unlocked($this->podcast->handle) ? 'unlocked' : null, ]), ); if (! ($cachedView = cache($cacheName))) { $themeData = EpisodeModel::$themes[$theme]; Loading modules/PremiumPodcasts/Filters/PodcastUnlockFilter.php +5 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,11 @@ class PodcastUnlockFilter implements FilterInterface return; } // Episode should be embeddable even if it is premium if ($current === route_to('embed', $episode->podcast->handle, $episode->slug)) { return; } // if podcast is locked then send to the unlock form /** @var PremiumPodcasts $premiumPodcasts */ $premiumPodcasts = service('premium_podcasts'); Loading themes/cp_app/embed.php +4 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,9 @@ <a href="<?= $episode->link ?>" class="flex flex-col items-start text-sm" style="color: <?= $themeData['text'] ?>;" target="_blank" rel="noopener noreferrer"> <h1 class="font-semibold leading-tight opacity-100 line-clamp-2 hover:opacity-75"><?= esc($episode->title) ?></h1> </a> <?php if ($episode->is_premium && ! is_unlocked($podcast->handle)): ?> <Button variant="primary" class="mt-auto mb-2" iconLeft="lock" uri="<?= $episode->link ?>" target="_blank" rel="noopener noreferrer"><?= lang('PremiumPodcasts.unlock') ?></Button> <?php else: ?> <vm-player id="castopod-vm-player" theme="<?= str_starts_with($theme, 'dark') ? 'dark' : 'light' ?>" Loading Loading @@ -60,6 +63,7 @@ </vm-controls> </vm-ui> </vm-player> <?php endif; ?> </div> </body> Loading themes/cp_app/episode/_partials/card.php +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ </div> <h2 class="flex-1 mt-1 font-semibold leading-tight line-clamp-2"><a class="hover:underline" href="<?= $episode->link ?>"><?= esc($episode->title) ?></a></h2> </div> <?php if ($episode->is_premium && ! subscription($podcast->handle)): ?> <?php if ($episode->is_premium && ! is_unlocked($podcast->handle)): ?> <a href="<?= route_to('episode', $episode->podcast->handle, $episode->slug) ?>" class="p-3 rounded-full bg-brand bg-accent-base text-accent-contrast hover:bg-accent-hover focus:ring-accent" title="<?= lang('PremiumPodcasts.unlock_episode') ?>" data-tooltip="bottom"> <Icon glyph="lock" class="text-xl" /> </a> Loading themes/cp_app/episode/_partials/preview_card.php +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ </div> <a href="<?= $episode->link ?>" class="flex items-baseline font-semibold line-clamp-2" title="<?= esc($episode->title) ?>"><?= esc($episode->title) ?></a> </div> <?php if ($episode->is_premium && ! subscription($episode->podcast->handle)): ?> <?php if ($episode->is_premium && ! is_unlocked($episode->podcast->handle)): ?> <a href="<?= route_to('episode', $episode->podcast->handle, $episode->slug) ?>" class="p-3 mr-4 rounded-full bg-brand bg-accent-base text-accent-contrast hover:bg-accent-hover focus:ring-accent" title="<?= lang('PremiumPodcasts.unlock_episode') ?>" data-tooltip="bottom"> <Icon glyph="lock" class="text-xl" /> </a> Loading Loading
app/Controllers/EpisodeController.php +13 −4 Original line number Diff line number Diff line Loading @@ -177,10 +177,19 @@ class EpisodeController extends BaseController $session->set('embed_domain', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST)); } $locale = service('request') ->getLocale(); $cacheName = "page_podcast#{$this->podcast->id}_episode#{$this->episode->id}_embed_{$theme}_{$locale}"; $cacheName = implode( '_', array_filter([ 'page', "podcast#{$this->podcast->id}", "episode#{$this->episode->id}", 'embed', $theme, service('request') ->getLocale(), is_unlocked($this->podcast->handle) ? 'unlocked' : null, ]), ); if (! ($cachedView = cache($cacheName))) { $themeData = EpisodeModel::$themes[$theme]; Loading
modules/PremiumPodcasts/Filters/PodcastUnlockFilter.php +5 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,11 @@ class PodcastUnlockFilter implements FilterInterface return; } // Episode should be embeddable even if it is premium if ($current === route_to('embed', $episode->podcast->handle, $episode->slug)) { return; } // if podcast is locked then send to the unlock form /** @var PremiumPodcasts $premiumPodcasts */ $premiumPodcasts = service('premium_podcasts'); Loading
themes/cp_app/embed.php +4 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,9 @@ <a href="<?= $episode->link ?>" class="flex flex-col items-start text-sm" style="color: <?= $themeData['text'] ?>;" target="_blank" rel="noopener noreferrer"> <h1 class="font-semibold leading-tight opacity-100 line-clamp-2 hover:opacity-75"><?= esc($episode->title) ?></h1> </a> <?php if ($episode->is_premium && ! is_unlocked($podcast->handle)): ?> <Button variant="primary" class="mt-auto mb-2" iconLeft="lock" uri="<?= $episode->link ?>" target="_blank" rel="noopener noreferrer"><?= lang('PremiumPodcasts.unlock') ?></Button> <?php else: ?> <vm-player id="castopod-vm-player" theme="<?= str_starts_with($theme, 'dark') ? 'dark' : 'light' ?>" Loading Loading @@ -60,6 +63,7 @@ </vm-controls> </vm-ui> </vm-player> <?php endif; ?> </div> </body> Loading
themes/cp_app/episode/_partials/card.php +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ </div> <h2 class="flex-1 mt-1 font-semibold leading-tight line-clamp-2"><a class="hover:underline" href="<?= $episode->link ?>"><?= esc($episode->title) ?></a></h2> </div> <?php if ($episode->is_premium && ! subscription($podcast->handle)): ?> <?php if ($episode->is_premium && ! is_unlocked($podcast->handle)): ?> <a href="<?= route_to('episode', $episode->podcast->handle, $episode->slug) ?>" class="p-3 rounded-full bg-brand bg-accent-base text-accent-contrast hover:bg-accent-hover focus:ring-accent" title="<?= lang('PremiumPodcasts.unlock_episode') ?>" data-tooltip="bottom"> <Icon glyph="lock" class="text-xl" /> </a> Loading
themes/cp_app/episode/_partials/preview_card.php +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ </div> <a href="<?= $episode->link ?>" class="flex items-baseline font-semibold line-clamp-2" title="<?= esc($episode->title) ?>"><?= esc($episode->title) ?></a> </div> <?php if ($episode->is_premium && ! subscription($episode->podcast->handle)): ?> <?php if ($episode->is_premium && ! is_unlocked($episode->podcast->handle)): ?> <a href="<?= route_to('episode', $episode->podcast->handle, $episode->slug) ?>" class="p-3 mr-4 rounded-full bg-brand bg-accent-base text-accent-contrast hover:bg-accent-hover focus:ring-accent" title="<?= lang('PremiumPodcasts.unlock_episode') ?>" data-tooltip="bottom"> <Icon glyph="lock" class="text-xl" /> </a> Loading