feat: support vtt in sync and fmt

This commit is contained in:
CDN 2025-04-23 15:29:27 +08:00
parent a6284897c8
commit 2fa12dbcde
Signed by: CDN
GPG key ID: 0C656827F9F80080
4 changed files with 122 additions and 1 deletions

View file

@ -7,6 +7,7 @@ import (
"sub-cli/internal/format/lrc"
"sub-cli/internal/format/srt"
"sub-cli/internal/format/vtt"
)
// Format formats a subtitle file to ensure consistent formatting
@ -18,6 +19,8 @@ func Format(filePath string) error {
return lrc.Format(filePath)
case "srt":
return srt.Format(filePath)
case "vtt":
return vtt.Format(filePath)
default:
return fmt.Errorf("unsupported format for formatting: %s", ext)
}