summaryrefslogtreecommitdiff
path: root/src/file-hasher/walker.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/file-hasher/walker.go')
-rw-r--r--src/file-hasher/walker.go24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/file-hasher/walker.go b/src/file-hasher/walker.go
index cc543a2..602f974 100644
--- a/src/file-hasher/walker.go
+++ b/src/file-hasher/walker.go
@@ -26,23 +26,19 @@ import (
"strings"
)
+var validExtensions []string
+
func checkFileExt(path string) bool {
- switch strings.ToLower(filepath.Ext(path)) {
- case ".flac":
- return true
- case ".ogg":
- return true
- case ".wav":
- return true
- case ".mp3":
- return true
- case ".aac":
- return true
- case ".mp4":
- return true
- case ".m4a":
+ if len(validExtensions) == 0 {
return true
}
+
+ ext := strings.ToLower(filepath.Ext(path))
+ for _, e := range validExtensions {
+ if ext == "."+e {
+ return true
+ }
+ }
return false
}