Skip to content

A self-hosted media server and file management system

chore: code smells

aminnausindeeea180c9e0
diff --git a/resources/js/components/video/transcript/TranscriptLine.vue b/resources/js/components/video/transcript/TranscriptLine.vue
index 7ad6e839..41025119 100644
--- a/resources/js/components/video/transcript/TranscriptLine.vue
+++ b/resources/js/components/video/transcript/TranscriptLine.vue
@@ -28,6 +28,6 @@ defineEmits<{ select: [start: number] }>();
>
{{ timestamp }}
</span>
- <span class="font-dm-sans line-clamp-3 leading-5 select-text" role="text" v-html="line.text"></span>
+ <span class="font-dm-sans line-clamp-3 leading-5 select-text" v-html="line.text"></span>
</button>
</template>
diff --git a/resources/js/components/video/transcript/TranscriptStatus.vue b/resources/js/components/video/transcript/TranscriptStatus.vue
index 70ed2b31..68cce306 100644
--- a/resources/js/components/video/transcript/TranscriptStatus.vue
+++ b/resources/js/components/video/transcript/TranscriptStatus.vue
@@ -9,7 +9,7 @@ defineEmits<{ action: [] }>();
</script>
<template>
- <div :class="cn('flex h-full flex-col items-center justify-center gap-3 px-8 py-10 text-center', $attrs.class)" role="status" aria-live="polite">
+ <div :class="cn('flex h-full flex-col items-center justify-center gap-3 px-8 py-10 text-center', $attrs.class)" aria-live="polite">
<div :class="cn('flex size-8 shrink-0 items-center justify-center rounded-full transition-colors sm:size-11', { 'bg-white/8 text-white/70': isBusy }, badgeClass)">
<ProiconsArrowClockwise v-if="isBusy" :class="cn('size-4 animate-spin sm:size-5', iconClass)" />
<slot v-else name="icon"></slot>
diff --git a/resources/js/components/video/transcript/transcriptParser.ts b/resources/js/components/video/transcript/transcriptParser.ts
index 40c1f306..6784473c 100644
--- a/resources/js/components/video/transcript/transcriptParser.ts
+++ b/resources/js/components/video/transcript/transcriptParser.ts
@@ -34,8 +34,8 @@ export function parseTranscript(rawTranscript: string): TranscriptLine[] {
if (!text) continue;
- const previous = lines[lines.length - 1];
- if (previous && previous.text === text && startTime <= previous.end) {
+ const previous = lines.at(-1);
+ if (previous?.text === text && startTime <= previous.end) {
previous.end = Math.max(previous.end, endTime);
continue;
}