diff --git a/.fuse_hidden000024c600000004 b/.fuse_hidden000024c600000004 new file mode 100755 index 0000000..e0116b2 Binary files /dev/null and b/.fuse_hidden000024c600000004 differ diff --git a/handle_file.go b/handle_file.go index 2221543..45d430d 100644 --- a/handle_file.go +++ b/handle_file.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "io" + "log" "os" "path/filepath" @@ -38,7 +39,6 @@ func HandleParsedFile(parsedFile *model.ParsedFile) { oldFilePrio, animeEpNotExistLocally := logic.GetAnimeEpProps(parsedFile.AnimeEpisode()) if !animeEpNotExistLocally || newFilePrio.Priority > oldFilePrio.Priority { - fmt.Println(animeEpNotExistLocally, newFilePrio, oldFilePrio) go func(parsedFile *model.ParsedFile) { if err := OrganizeAnimeEpisode(parsedFile); err != nil { adverr.Println(err) @@ -52,7 +52,7 @@ func OrganizeAnimeEpisode(parsedFile *model.ParsedFile) error { newFile := logic.GetAnimeEpFilepath(parsedFile.AnimeEpisode(), filepath.Ext(parsedFile.File)) lockFile := logic.GetAnimeEpFilepath(parsedFile.AnimeEpisode(), "lock") - fmt.Printf("move file '%s' to '%s'\n", oldFile, newFile) + log.Printf("move file '%s' to '%s'\n", oldFile, newFile) if err := os.MkdirAll(filepath.Dir(newFile), os.ModePerm); err != nil { return err @@ -96,7 +96,7 @@ func OrganizeAnimeEpisode(parsedFile *model.ParsedFile) error { return err } - fmt.Printf("file '%s' moved\n", newFile) + log.Printf("file '%s' moved\n", newFile) return nil } diff --git a/main.go b/main.go index ee3b092..b55fc0d 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - "fmt" + "log" "git.milar.in/nyaanime/logic" "github.com/fsnotify/fsnotify" @@ -22,9 +22,9 @@ func main() { fileHandled := HandleFile(file) if fileHandled { - fmt.Println("file handled:", file) + log.Println("file handled:", file) } else { - fmt.Println("file ignored:", file) + log.Println("file ignored:", file) } } } diff --git a/organizer b/organizer new file mode 100755 index 0000000..163d703 Binary files /dev/null and b/organizer differ