organizer/main.go

23 lines
462 B
Go
Raw Normal View History

2023-01-13 19:23:36 +01:00
package main
import (
"git.milar.in/nyaanime/logic"
"github.com/fsnotify/fsnotify"
)
func main() {
// get access token once at startup to be sure that an access token is obtainable at all
if _, err := logic.GetAnilistAccessToken(); err != nil {
panic(err) // TODO error handling
}
fsChan, err := WatchDirectory(fsnotify.Create, DownloadPath)
if err != nil {
panic(err) // TODO error handling
}
for file := range fsChan {
HandleFile(file)
}
}