Files
zurg/internal/torrent/util.go
Ben Sarmiento 54ab801796 Finalize repair
2023-10-26 03:29:13 +02:00

25 lines
495 B
Go

package torrent
import (
"fmt"
"strings"
)
func getFileIDs(files []File) []string {
var fileIDs []string
for _, file := range files {
if file.ID != 0 {
fileIDs = append(fileIDs, fmt.Sprintf("%d", file.ID))
}
}
return fileIDs
}
func isStreamable(filePath string) bool {
return strings.HasSuffix(filePath, ".mkv") ||
strings.HasSuffix(filePath, ".mp4") ||
strings.HasSuffix(filePath, ".avi") ||
strings.HasSuffix(filePath, ".wmv") ||
strings.HasSuffix(filePath, ".m4v")
}