From 87f81f79c11c51dcea940ea08606f8e44ff3eaed Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Mon, 14 Oct 2019 10:58:46 +1100 Subject: [PATCH] Make IsStreamable return using codec not MIME type --- pkg/manager/utils.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/manager/utils.go b/pkg/manager/utils.go index 9967aa0d1..af767a291 100644 --- a/pkg/manager/utils.go +++ b/pkg/manager/utils.go @@ -2,6 +2,8 @@ package manager import ( "fmt" + + "github.com/stashapp/stash/pkg/ffmpeg" "github.com/stashapp/stash/pkg/models" "github.com/stashapp/stash/pkg/utils" ) @@ -10,15 +12,11 @@ func IsStreamable(scene *models.Scene) (bool, error) { if scene == nil { return false, fmt.Errorf("nil scene") } - fileType, err := utils.FileType(scene.Path) - if err != nil { - return false, err - } - switch fileType.MIME.Value { - case "video/quicktime", "video/mp4", "video/webm", "video/x-m4v": + videoCodec := scene.VideoCodec.String + if ffmpeg.IsValidCodec(videoCodec) { return true, nil - default: + } else { hasTranscode, _ := HasTranscode(scene) return hasTranscode, nil }