Finalize repair

This commit is contained in:
Ben Sarmiento
2023-10-26 03:29:13 +02:00
parent cc9616894a
commit 54ab801796
13 changed files with 500 additions and 517 deletions

24
internal/torrent/util.go Normal file
View File

@@ -0,0 +1,24 @@
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")
}