diff --git a/main.go b/main.go index a7ca7d1..67e3d76 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,7 @@ var ( // flags FlagSourceDir = envvars.String("SOURCE_PATH", "/video") FlagTargetDir = envvars.String("TARGET_PATH", "/audio") FlagCacheFile = envvars.String("CACHE_FILE", "/hashes.bin") - FlagExcludeFiles = envvars.StringSlice("EXCLUDE_FILES", ":", []string{".songs"}) + FlagExcludeFiles = envvars.StringSlice("EXCLUDE_FILES", ":", []string{".songs", ".stversions"}) FlagUpdateCacheFileInterval = envvars.Duration("UPDATE_CACHE_FILE_INTERVAL", 10*time.Second) ) @@ -68,6 +68,11 @@ func main() { filesByGroup := channel.FlatMap(groupedFiles, func(key string, _ struct{}) string { return key }) filteredFiles := channel.Filter(filesByGroup, Or(Not(Exists), And(SymlinkFilesOnly, VideosOnly))) + filteredFiles = channel.MapSuccessive(filteredFiles, func(s string) string { + fmt.Println("DEBUG", s) + return s + }) + for file := range filteredFiles { if err := TranscodeFile(file); err != nil { fmt.Fprintln(os.Stderr, fmt.Errorf("could not transcode file '%s': %w", file, err)) diff --git a/watch_dir.go b/watch_dir.go index 5b57e49..117fe26 100644 --- a/watch_dir.go +++ b/watch_dir.go @@ -63,6 +63,8 @@ func WatchDirectory(ctx context.Context, path string, op ...fsnotify.Op) (<-chan } } + fmt.Println("DEBUG", "done providing existing files") + for { select { case event, ok := <-watcher.Events: