mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Make IsStreamable return using codec not MIME type
This commit is contained in:
@@ -2,6 +2,8 @@ package manager
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/stashapp/stash/pkg/ffmpeg"
|
||||||
"github.com/stashapp/stash/pkg/models"
|
"github.com/stashapp/stash/pkg/models"
|
||||||
"github.com/stashapp/stash/pkg/utils"
|
"github.com/stashapp/stash/pkg/utils"
|
||||||
)
|
)
|
||||||
@@ -10,15 +12,11 @@ func IsStreamable(scene *models.Scene) (bool, error) {
|
|||||||
if scene == nil {
|
if scene == nil {
|
||||||
return false, fmt.Errorf("nil scene")
|
return false, fmt.Errorf("nil scene")
|
||||||
}
|
}
|
||||||
fileType, err := utils.FileType(scene.Path)
|
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
switch fileType.MIME.Value {
|
videoCodec := scene.VideoCodec.String
|
||||||
case "video/quicktime", "video/mp4", "video/webm", "video/x-m4v":
|
if ffmpeg.IsValidCodec(videoCodec) {
|
||||||
return true, nil
|
return true, nil
|
||||||
default:
|
} else {
|
||||||
hasTranscode, _ := HasTranscode(scene)
|
hasTranscode, _ := HasTranscode(scene)
|
||||||
return hasTranscode, nil
|
return hasTranscode, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user