mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-23 15:30:34 -04:00
Fast track extractions if there is no subtitles (#548)
This commit is contained in:
commit
e47c6500f3
@ -91,6 +91,10 @@ func GetMimeCodec(stream *ffprobe.Stream) *string {
|
|||||||
|
|
||||||
return &ret
|
return &ret
|
||||||
|
|
||||||
|
case "mp3":
|
||||||
|
ret := "mp4a.40.34"
|
||||||
|
return &ret
|
||||||
|
|
||||||
case "opus":
|
case "opus":
|
||||||
ret := "Opus"
|
ret := "Opus"
|
||||||
return &ret
|
return &ret
|
||||||
@ -107,6 +111,10 @@ func GetMimeCodec(stream *ffprobe.Stream) *string {
|
|||||||
ret := "fLaC"
|
ret := "fLaC"
|
||||||
return &ret
|
return &ret
|
||||||
|
|
||||||
|
case "alac":
|
||||||
|
ret := "alac"
|
||||||
|
return &ret
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log.Printf("No known mime format for: %s", stream.CodecName)
|
log.Printf("No known mime format for: %s", stream.CodecName)
|
||||||
return nil
|
return nil
|
||||||
|
@ -29,6 +29,12 @@ func Extract(path string, sha string) (<-chan struct{}, error) {
|
|||||||
os.MkdirAll(attachment_path, 0o644)
|
os.MkdirAll(attachment_path, 0o644)
|
||||||
os.MkdirAll(subs_path, 0o755)
|
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(
|
cmd := exec.Command(
|
||||||
"ffmpeg",
|
"ffmpeg",
|
||||||
"-dump_attachment:t", "",
|
"-dump_attachment:t", "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user