refactor: strip debug noise to reduce bundle

This commit is contained in:
Mert Uyanık
2025-10-29 09:06:29 +03:00
parent a00cfe2249
commit 60adb36721
7 changed files with 51 additions and 95 deletions
+7 -12
View File
@@ -45,18 +45,13 @@ export const createSubtitleBlobURL = (content: string, format: 'vtt' | 'srt'): s
* Fetch and parse subtitle file
*/
export const fetchSubtitle = async (url: string): Promise<string> => {
try {
const response = await fetch(url)
const content = await response.text()
const response = await fetch(url)
const content = await response.text()
// Detect format
if (url.endsWith('.srt')) {
return parseSRT(content)
}
return content
} catch (error) {
console.error('Failed to fetch subtitle:', error)
throw error
// Detect format
if (url.endsWith('.srt')) {
return parseSRT(content)
}
return content
}