Finalize repair
This commit is contained in:
24
internal/torrent/util.go
Normal file
24
internal/torrent/util.go
Normal 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")
|
||||
}
|
||||
Reference in New Issue
Block a user