mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-06 18:31:05 +00:00
fix: add explicit int conversion when formatting episode duration
This commit is contained in:
parent
fbffdbde78
commit
1253096197
@ -29,9 +29,9 @@
|
|||||||
'cell' => function ($episode, $podcast) {
|
'cell' => function ($episode, $podcast) {
|
||||||
return '<div class="flex">' .
|
return '<div class="flex">' .
|
||||||
'<div class="relative flex-shrink-0 mr-2">' .
|
'<div class="relative flex-shrink-0 mr-2">' .
|
||||||
'<time class="absolute px-1 text-xs font-semibold text-white rounded bottom-2 right-2 bg-black/50" datetime="PT<?= $episode->audio->duration ?>S">' .
|
'<time class="absolute px-1 text-xs font-semibold text-white rounded bottom-2 right-2 bg-black/50" datetime="PT' . round($episode->audio->duration, 3) . 'S">' .
|
||||||
format_duration(
|
format_duration(
|
||||||
$episode->audio->duration,
|
(int) $episode->audio->duration,
|
||||||
) .
|
) .
|
||||||
'</time>' .
|
'</time>' .
|
||||||
'<img src="' . $episode->cover->thumbnail_url . '" alt="' . esc($episode->title) . '" class="object-cover w-20 rounded-lg shadow-inner aspect-square" loading="lazy" />' .
|
'<img src="' . $episode->cover->thumbnail_url . '" alt="' . esc($episode->title) . '" class="object-cover w-20 rounded-lg shadow-inner aspect-square" loading="lazy" />' .
|
||||||
|
@ -54,8 +54,8 @@
|
|||||||
) ?>
|
) ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-xs text-skin-muted">
|
<div class="text-xs text-skin-muted">
|
||||||
<time datetime="PT<?= $episode->audio->duration ?>S">
|
<time datetime="PT<?= round($episode->audio->duration, 3) ?>S">
|
||||||
<?= format_duration($episode->audio->duration) ?>
|
<?= format_duration((int) $episode->audio->duration) ?>
|
||||||
</time>
|
</time>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -58,8 +58,8 @@
|
|||||||
<div class="text-xs text-skin-muted">
|
<div class="text-xs text-skin-muted">
|
||||||
<?= relative_time($episode->published_at) ?>
|
<?= relative_time($episode->published_at) ?>
|
||||||
<span class="mx-1">•</span>
|
<span class="mx-1">•</span>
|
||||||
<time datetime="PT<?= $episode->audio->duration ?>S">
|
<time datetime="PT<?= round($episode->audio->duration, 3) ?>S">
|
||||||
<?= format_duration($episode->audio->duration) ?>
|
<?= format_duration((int) $episode->audio->duration) ?>
|
||||||
</time>
|
</time>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -72,7 +72,7 @@ use CodeIgniter\I18n\Time;
|
|||||||
if ($videoClip->job_started_at !== null) {
|
if ($videoClip->job_started_at !== null) {
|
||||||
if ($videoClip->job_ended_at !== null) {
|
if ($videoClip->job_ended_at !== null) {
|
||||||
$duration = '<div class="flex flex-col text-xs gap-y-1">' .
|
$duration = '<div class="flex flex-col text-xs gap-y-1">' .
|
||||||
'<div class="inline-flex items-center font-mono gap-x-1"><Icon glyph="timer" class="text-sm text-gray-400" />' . format_duration($videoClip->job_duration, true) . '</div>' .
|
'<div class="inline-flex items-center font-mono gap-x-1"><Icon glyph="timer" class="text-sm text-gray-400" />' . format_duration((int) $videoClip->job_duration, true) . '</div>' .
|
||||||
'<div class="inline-flex items-center gap-x-1"><Icon glyph="calendar" class="text-sm text-gray-400" />' . relative_time($videoClip->job_ended_at) . '</div>' .
|
'<div class="inline-flex items-center gap-x-1"><Icon glyph="calendar" class="text-sm text-gray-400" />' . relative_time($videoClip->job_ended_at) . '</div>' .
|
||||||
'</div>';
|
'</div>';
|
||||||
} else {
|
} else {
|
||||||
|
@ -125,7 +125,7 @@
|
|||||||
<?= relative_time($episode->published_at) ?>
|
<?= relative_time($episode->published_at) ?>
|
||||||
<span class="mx-1">•</span>
|
<span class="mx-1">•</span>
|
||||||
<time datetime="PT<?= round($episode->audio->duration, 3) ?>S">
|
<time datetime="PT<?= round($episode->audio->duration, 3) ?>S">
|
||||||
<?= format_duration_symbol($episode->audio->duration) ?>
|
<?= format_duration_symbol((int) $episode->audio->duration) ?>
|
||||||
</time>
|
</time>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<article class="flex w-full p-4 shadow bg-elevated rounded-conditional-2xl gap-x-2">
|
<article class="flex w-full p-4 shadow bg-elevated rounded-conditional-2xl gap-x-2">
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<time class="absolute px-1 text-xs font-semibold text-white rounded bottom-2 right-2 bg-black/75" datetime="PT<?= round($episode->audio->duration, 3) ?>S">
|
<time class="absolute px-1 text-xs font-semibold text-white rounded bottom-2 right-2 bg-black/75" datetime="PT<?= round($episode->audio->duration, 3) ?>S">
|
||||||
<?= format_duration($episode->audio->duration) ?>
|
<?= format_duration((int) $episode->audio->duration) ?>
|
||||||
</time>
|
</time>
|
||||||
<img src="<?= $episode->cover
|
<img src="<?= $episode->cover
|
||||||
->thumbnail_url ?>" alt="<?= esc($episode->title) ?>" class="object-cover w-20 rounded-lg shadow-inner aspect-square" loading="lazy" />
|
->thumbnail_url ?>" alt="<?= esc($episode->title) ?>" class="object-cover w-20 rounded-lg shadow-inner aspect-square" loading="lazy" />
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<div class="flex items-center border-y border-subtle">
|
<div class="flex items-center border-y border-subtle">
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<time class="absolute px-1 text-sm font-semibold text-white rounded bg-black/75 bottom-2 right-2" datetime="PT<?= round($episode->audio->duration, 3) ?>S">
|
<time class="absolute px-1 text-sm font-semibold text-white rounded bg-black/75 bottom-2 right-2" datetime="PT<?= round($episode->audio->duration, 3) ?>S">
|
||||||
<?= format_duration($episode->audio->duration) ?>
|
<?= format_duration((int) $episode->audio->duration) ?>
|
||||||
</time>
|
</time>
|
||||||
<img
|
<img
|
||||||
src="<?= $episode->cover->thumbnail_url ?>"
|
src="<?= $episode->cover->thumbnail_url ?>"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user