syncthing debug
This commit is contained in:
parent
6f6dfc90b2
commit
715433d748
7
main.go
7
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))
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user