diff --git a/apps/web/src/lib/subtitles/parse.ts b/apps/web/src/lib/subtitles/parse.ts index 5f5d07cc..da5e2930 100644 --- a/apps/web/src/lib/subtitles/parse.ts +++ b/apps/web/src/lib/subtitles/parse.ts @@ -23,11 +23,7 @@ export function parseSubtitleFile({ } } -function getFileExtension({ - fileName, -}: { - fileName: string; -}): string { +function getFileExtension({ fileName }: { fileName: string }): string { const extension = fileName.split(".").pop(); return extension?.toLowerCase() ?? ""; } diff --git a/apps/web/src/lib/subtitles/srt.ts b/apps/web/src/lib/subtitles/srt.ts index a5377b0b..98ff90e6 100644 --- a/apps/web/src/lib/subtitles/srt.ts +++ b/apps/web/src/lib/subtitles/srt.ts @@ -5,11 +5,7 @@ const TIMESTAMP_SEPARATOR = /\s*-->\s*/; const TIMESTAMP_PATTERN = /^(\d{2}:\d{2}:\d{2}[,.]\d{1,3})\s*-->\s*(\d{2}:\d{2}:\d{2}[,.]\d{1,3})/; -export function parseSrt({ - input, -}: { - input: string; -}): ParseSubtitleResult { +export function parseSrt({ input }: { input: string }): ParseSubtitleResult { const normalized = input.replace(/\r\n?/g, "\n").trim(); if (!normalized) { return { @@ -79,11 +75,7 @@ export function parseSrt({ }; } -function parseSrtTimestamp({ - input, -}: { - input: string; -}): number { +function parseSrtTimestamp({ input }: { input: string }): number { const normalized = input.trim().replace(",", "."); const match = normalized.match(/^(\d{2}):(\d{2}):(\d{2})\.(\d{1,3})$/); if (!match) { @@ -94,10 +86,7 @@ function parseSrtTimestamp({ const parsedHours = Number.parseInt(hours, 10); const parsedMinutes = Number.parseInt(minutes, 10); const parsedSeconds = Number.parseInt(seconds, 10); - const parsedMilliseconds = Number.parseInt( - milliseconds.padEnd(3, "0"), - 10, - ); + const parsedMilliseconds = Number.parseInt(milliseconds.padEnd(3, "0"), 10); return ( parsedHours * 3600 +