diff --git a/handle_file.go b/handle_file.go index bfa3571..2221543 100644 --- a/handle_file.go +++ b/handle_file.go @@ -13,7 +13,7 @@ import ( "git.milar.in/nyaanime/parsers" ) -func HandleFile(path string) { +func HandleFile(path string) bool { for _, parser := range parsers.Parsers { parsedFile, ok := parser.FileParser(&parser, path) if !ok { @@ -27,7 +27,10 @@ func HandleFile(path string) { parsedFile.Anime = anime HandleParsedFile(parsedFile) + return true } + + return false } func HandleParsedFile(parsedFile *model.ParsedFile) { diff --git a/main.go b/main.go index 2430264..0fa1604 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,8 @@ package main import ( + "fmt" + "git.milar.in/nyaanime/logic" "github.com/fsnotify/fsnotify" ) @@ -17,6 +19,12 @@ func main() { } for file := range fsChan { - HandleFile(file) + fmt.Print("file found:", file) + + fileHandled := HandleFile(file) + + if !fileHandled { + fmt.Print("file ignored:", file) + } } }