31 lines
529 B
Go
31 lines
529 B
Go
package main
|
|
|
|
import (
|
|
"os/exec"
|
|
"time"
|
|
|
|
"git.milar.in/nyaanime/logic"
|
|
)
|
|
|
|
func main() {
|
|
// check for ffprobe in PATH
|
|
if _, err := exec.LookPath("ffprobe"); err != nil {
|
|
panic(err) // TODO error handling
|
|
}
|
|
|
|
// 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)
|
|
}
|
|
|
|
logic.PrintPriorityTables()
|
|
|
|
ticker := time.NewTicker(PollRate)
|
|
defer ticker.Stop()
|
|
|
|
CheckTorrents()
|
|
for range ticker.C {
|
|
CheckTorrents()
|
|
}
|
|
}
|