Detect arithmetic progression

This commit is contained in:
Ben Sarmiento
2023-11-21 18:16:37 +01:00
parent a288f08ff7
commit 1995a86f29
5 changed files with 128 additions and 22 deletions

View File

@@ -3,7 +3,6 @@ package torrent
import (
"fmt"
"os"
"strings"
)
func getFileIDs(files []File) []string {
@@ -16,14 +15,6 @@ func getFileIDs(files []File) []string {
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")
}
func ensureDir(dirName string) error {
if _, err := os.Stat(dirName); os.IsNotExist(err) {
err := os.Mkdir(dirName, 0755)