check for ffprobe installed
This commit is contained in:
parent
326d128bd1
commit
1f13aee410
16
main.go
16
main.go
@ -2,23 +2,29 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
"git.milar.in/nyaanime/logic"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("generated priority values:")
|
||||
fmt.Print(Map2Table("language", logic.PreferredLanguages))
|
||||
fmt.Print(Map2Table("subtitle", logic.PreferredSubtitles))
|
||||
fmt.Print(Map2Table("resolution", logic.PreferredResolutions))
|
||||
fmt.Println()
|
||||
// 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)
|
||||
}
|
||||
|
||||
fmt.Println("generated priority values:")
|
||||
fmt.Print(Map2Table("language", logic.PreferredLanguages))
|
||||
fmt.Print(Map2Table("subtitle", logic.PreferredSubtitles))
|
||||
fmt.Print(Map2Table("resolution", logic.PreferredResolutions))
|
||||
fmt.Println()
|
||||
|
||||
ticker := time.NewTicker(PollRate)
|
||||
defer ticker.Stop()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user