25 lines
495 B
Go
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")
|
|
}
|