refactor: strip debug noise to reduce bundle
This commit is contained in:
+7
-12
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user