Fast track extractions if there is no subtitles

This commit is contained in:
2024-06-19 12:25:43 +00:00
parent 3f238fb0cb
commit c707e76bd6

View File

@@ -29,6 +29,12 @@ func Extract(path string, sha string) (<-chan struct{}, error) {
os.MkdirAll(attachment_path, 0o644)
os.MkdirAll(subs_path, 0o755)
// If there is no subtitles, there is nothing to extract (also fonts would be useless).
if len(info.Subtitles) == 0 {
close(ret)
return
}
cmd := exec.Command(
"ffmpeg",
"-dump_attachment:t", "",