mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-13 03:27:45 +02:00
feat(video-clip): add video-clip page with video preview + logs
This commit is contained in:
parent
2065ebbee5
commit
42538dd757
11 changed files with 106 additions and 14 deletions
|
|
@ -114,6 +114,26 @@ class ClipModel extends Model
|
|||
return $found;
|
||||
}
|
||||
|
||||
public function getVideoClipById(int $videoClipId): ?VideoClip
|
||||
{
|
||||
$cacheName = "video-clip#{$videoClipId}";
|
||||
if (! ($found = cache($cacheName))) {
|
||||
$clip = $this->find($videoClipId);
|
||||
|
||||
if ($clip === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// @phpstan-ignore-next-line
|
||||
$found = new VideoClip($clip->toArray());
|
||||
|
||||
cache()
|
||||
->save($cacheName, $found, DECADE);
|
||||
}
|
||||
|
||||
return $found;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all video clips for an episode
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue