Additional playable extensions

This commit is contained in:
Ben Sarmiento
2024-02-03 03:44:44 +01:00
parent 004257c7a7
commit 9a8b1553a2
6 changed files with 63 additions and 44 deletions

15
pkg/utils/playable.go Normal file
View File

@@ -0,0 +1,15 @@
package utils
import "strings"
func IsPlayable(filePath string) bool {
filePath = strings.ToLower(filePath)
return strings.HasSuffix(filePath, ".avi") ||
strings.HasSuffix(filePath, ".m2ts") ||
strings.HasSuffix(filePath, ".m4v") ||
strings.HasSuffix(filePath, ".mkv") ||
strings.HasSuffix(filePath, ".mp4") ||
strings.HasSuffix(filePath, ".mpg") ||
strings.HasSuffix(filePath, ".ts") ||
strings.HasSuffix(filePath, ".wmv")
}