2022-08-15 15:55:27 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"time"
|
2023-01-13 13:38:51 +01:00
|
|
|
|
|
|
|
"git.milar.in/nyaanime/logic"
|
2022-08-15 15:55:27 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2022-08-25 18:13:29 +02:00
|
|
|
fmt.Println("generated priority values:")
|
2023-01-13 13:38:51 +01:00
|
|
|
fmt.Print(Map2Table("language", logic.PreferredLanguages))
|
|
|
|
fmt.Print(Map2Table("subtitle", logic.PreferredSubtitles))
|
|
|
|
fmt.Print(Map2Table("resolution", logic.PreferredResolutions))
|
2022-08-25 18:13:29 +02:00
|
|
|
fmt.Println()
|
2022-08-21 21:14:44 +02:00
|
|
|
|
2022-08-15 15:55:27 +02:00
|
|
|
// get access token once at startup to be sure that an access token is obtainable at all
|
2023-01-13 13:38:51 +01:00
|
|
|
if _, err := logic.GetAnilistAccessToken(); err != nil {
|
2022-08-15 15:55:27 +02:00
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
ticker := time.NewTicker(PollRate)
|
|
|
|
defer ticker.Stop()
|
|
|
|
|
2023-01-13 13:38:51 +01:00
|
|
|
CheckTorrents()
|
2022-08-15 15:55:27 +02:00
|
|
|
for range ticker.C {
|
2023-01-13 13:38:51 +01:00
|
|
|
CheckTorrents()
|
2022-08-15 15:55:27 +02:00
|
|
|
}
|
|
|
|
}
|