Loading app/Entities/Episode.php +12 −0 Original line number Diff line number Diff line Loading @@ -688,4 +688,16 @@ class Episode extends Entity return url_to('episode-preview', (string) $this->preview_id); } /** * Returns the episode's clip count */ public function getClipCount(): int|string { if ($this->id === null) { throw new RuntimeException('Episode must be created before getting number of video clips.'); } return (new ClipModel())->getClipCount($this->podcast_id, $this->id); } } app/Models/ClipModel.php +10 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,16 @@ class ClipModel extends Model ]); } public function getClipCount(int $podcastId, int $episodeId): int { return $this ->where([ 'podcast_id' => $podcastId, 'episode_id' => $episodeId, ]) ->countAllResults(); } public function clearVideoClipCache(int $clipId): void { cache() Loading themes/cp_admin/episode/_sidebar.php +5 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ $episodeNavigation = [ 'clips' => [ 'icon' => 'clapperboard', 'items' => ['video-clips-list', 'video-clips-create', 'soundbites-list', 'soundbites-create'], 'count' => $episode->getClipCount(), 'count-route' => 'video-clips-list', 'add-cta' => 'video-clips-create', ], ]; ?> Loading themes/cp_admin/podcast/create.php +19 −21 Original line number Diff line number Diff line Loading @@ -56,27 +56,6 @@ isChecked="false" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton> </div> </fieldset> </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.fediverse_section_title') ?>" subtitle="<?= lang('Podcast.form.fediverse_section_subtitle') ?>" > <div class="flex flex-col"> <Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label> <div class="relative"> <Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" /> <Forms.Input name="handle" class="w-full pl-8" required="true" /> </div> </div> <Forms.Field name="banner" label="<?= lang('Podcast.form.banner') ?>" helper="<?= lang('Podcast.form.banner_size_hint') ?>" type="file" accept=".jpg,.jpeg,.png" /> </Forms.Section> <Forms.Section Loading Loading @@ -153,6 +132,25 @@ </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.fediverse_section_title') ?>" > <div class="flex flex-col"> <Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label> <div class="relative"> <Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" /> <Forms.Input name="handle" class="w-full pl-8" required="true" /> </div> </div> <Forms.Field name="banner" label="<?= lang('Podcast.form.banner') ?>" helper="<?= lang('Podcast.form.banner_size_hint') ?>" type="file" accept=".jpg,.jpeg,.png" /> </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.premium') ?>"> <Forms.Toggler class="mt-2" name="premium_by_default" value="yes" checked="false" hint="<?= lang('Podcast.form.premium_by_default_hint') ?>"> <?= lang('Podcast.form.premium_by_default') ?></Forms.Toggler> Loading themes/cp_admin/podcast/edit.php +20 −21 Original line number Diff line number Diff line Loading @@ -78,27 +78,6 @@ isChecked="<?= $podcast->type === 'serial' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton> </div> </fieldset> </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.fediverse_section_title') ?>" > <div class="flex flex-col"> <Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label> <div class="relative"> <Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" /> <Forms.Input name="handle" value="<?= $podcast->handle ?>" class="w-full pl-8" required="true" readonly="true" /> </div> </div> <Forms.Field name="banner" label="<?= lang('Podcast.form.banner') ?>" helper="<?= lang('Podcast.form.banner_size_hint') ?>" type="file" accept=".jpg,.jpeg,.png" /> </Forms.Section> <Forms.Section Loading Loading @@ -181,6 +160,26 @@ </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.fediverse_section_title') ?>" > <div class="flex flex-col"> <Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label> <div class="relative"> <Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" /> <Forms.Input name="handle" value="<?= $podcast->handle ?>" class="w-full pl-8" required="true" readonly="true" /> </div> </div> <Forms.Field name="banner" label="<?= lang('Podcast.form.banner') ?>" helper="<?= lang('Podcast.form.banner_size_hint') ?>" type="file" accept=".jpg,.jpeg,.png" /> </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.premium') ?>"> <Forms.Toggler class="mt-2" name="premium_by_default" value="yes" checked="<?= $podcast->is_premium_by_default ? 'true' : 'false' ?>" hint="<?= lang('Podcast.form.premium_by_default_hint') ?>"> <?= lang('Podcast.form.premium_by_default') ?></Forms.Toggler> Loading Loading
app/Entities/Episode.php +12 −0 Original line number Diff line number Diff line Loading @@ -688,4 +688,16 @@ class Episode extends Entity return url_to('episode-preview', (string) $this->preview_id); } /** * Returns the episode's clip count */ public function getClipCount(): int|string { if ($this->id === null) { throw new RuntimeException('Episode must be created before getting number of video clips.'); } return (new ClipModel())->getClipCount($this->podcast_id, $this->id); } }
app/Models/ClipModel.php +10 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,16 @@ class ClipModel extends Model ]); } public function getClipCount(int $podcastId, int $episodeId): int { return $this ->where([ 'podcast_id' => $podcastId, 'episode_id' => $episodeId, ]) ->countAllResults(); } public function clearVideoClipCache(int $clipId): void { cache() Loading
themes/cp_admin/episode/_sidebar.php +5 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ $episodeNavigation = [ 'clips' => [ 'icon' => 'clapperboard', 'items' => ['video-clips-list', 'video-clips-create', 'soundbites-list', 'soundbites-create'], 'count' => $episode->getClipCount(), 'count-route' => 'video-clips-list', 'add-cta' => 'video-clips-create', ], ]; ?> Loading
themes/cp_admin/podcast/create.php +19 −21 Original line number Diff line number Diff line Loading @@ -56,27 +56,6 @@ isChecked="false" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton> </div> </fieldset> </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.fediverse_section_title') ?>" subtitle="<?= lang('Podcast.form.fediverse_section_subtitle') ?>" > <div class="flex flex-col"> <Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label> <div class="relative"> <Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" /> <Forms.Input name="handle" class="w-full pl-8" required="true" /> </div> </div> <Forms.Field name="banner" label="<?= lang('Podcast.form.banner') ?>" helper="<?= lang('Podcast.form.banner_size_hint') ?>" type="file" accept=".jpg,.jpeg,.png" /> </Forms.Section> <Forms.Section Loading Loading @@ -153,6 +132,25 @@ </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.fediverse_section_title') ?>" > <div class="flex flex-col"> <Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label> <div class="relative"> <Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" /> <Forms.Input name="handle" class="w-full pl-8" required="true" /> </div> </div> <Forms.Field name="banner" label="<?= lang('Podcast.form.banner') ?>" helper="<?= lang('Podcast.form.banner_size_hint') ?>" type="file" accept=".jpg,.jpeg,.png" /> </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.premium') ?>"> <Forms.Toggler class="mt-2" name="premium_by_default" value="yes" checked="false" hint="<?= lang('Podcast.form.premium_by_default_hint') ?>"> <?= lang('Podcast.form.premium_by_default') ?></Forms.Toggler> Loading
themes/cp_admin/podcast/edit.php +20 −21 Original line number Diff line number Diff line Loading @@ -78,27 +78,6 @@ isChecked="<?= $podcast->type === 'serial' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton> </div> </fieldset> </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.fediverse_section_title') ?>" > <div class="flex flex-col"> <Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label> <div class="relative"> <Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" /> <Forms.Input name="handle" value="<?= $podcast->handle ?>" class="w-full pl-8" required="true" readonly="true" /> </div> </div> <Forms.Field name="banner" label="<?= lang('Podcast.form.banner') ?>" helper="<?= lang('Podcast.form.banner_size_hint') ?>" type="file" accept=".jpg,.jpeg,.png" /> </Forms.Section> <Forms.Section Loading Loading @@ -181,6 +160,26 @@ </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.fediverse_section_title') ?>" > <div class="flex flex-col"> <Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label> <div class="relative"> <Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" /> <Forms.Input name="handle" value="<?= $podcast->handle ?>" class="w-full pl-8" required="true" readonly="true" /> </div> </div> <Forms.Field name="banner" label="<?= lang('Podcast.form.banner') ?>" helper="<?= lang('Podcast.form.banner_size_hint') ?>" type="file" accept=".jpg,.jpeg,.png" /> </Forms.Section> <Forms.Section title="<?= lang('Podcast.form.premium') ?>"> <Forms.Toggler class="mt-2" name="premium_by_default" value="yes" checked="<?= $podcast->is_premium_by_default ? 'true' : 'false' ?>" hint="<?= lang('Podcast.form.premium_by_default_hint') ?>"> <?= lang('Podcast.form.premium_by_default') ?></Forms.Toggler> Loading