From 08d82cc749763cda137f03947e47d4172b9fd8cc Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 21 Aug 2023 01:16:33 -0700 Subject: [PATCH] Fix missing timestamp on first chapter --- .../views/components/description_chapters_widget.ecr | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/invidious/views/components/description_chapters_widget.ecr b/src/invidious/views/components/description_chapters_widget.ecr index 8fca9d36..ff2dbcc0 100644 --- a/src/invidious/views/components/description_chapters_widget.ecr +++ b/src/invidious/views/components/description_chapters_widget.ecr @@ -3,8 +3,9 @@

Chapters

- <% chapters.each do | chapter |%> - + <% chapters.each do | chapter | %> + <%- start_in_seconds = chapter.start_ms.milliseconds.total_seconds.to_i %> +
<%- if !env.get("preferences").as(Preferences).thin_mode -%> @@ -13,7 +14,11 @@
<%- end -%>
-

<%-= recode_length_seconds(chapter.start_ms.milliseconds.total_seconds) -%>

+ <%- if start_in_seconds > 0 -%> +

<%-= recode_length_seconds(start_in_seconds) -%>

+ <%- else -%> +

0:00

+ <%- end -%>

<%-=chapter.title-%>