stash/manager/utils.go

17 lines
518 B
Go
Raw Normal View History

2019-02-09 12:30:49 +00:00
package manager
2019-02-10 02:53:08 +00:00
import "github.com/stashapp/stash/utils"
2019-02-09 12:30:49 +00:00
func IsStreamable(videoPath string, checksum string) (bool, error) {
fileType, err := utils.FileType(videoPath)
if err != nil {
return false, err
}
if fileType.MIME.Value == "video/quicktime" || fileType.MIME.Value == "video/mp4" || fileType.MIME.Value == "video/webm" || fileType.MIME.Value == "video/x-m4v" {
return true, nil
} else {
transcodePath := instance.Paths.Scene.GetTranscodePath(checksum)
return utils.FileExists(transcodePath)
}
}