Use bs5-jf on setup, fix bugs

No longer quits if the program times out connecting to the given
jellyfin host.
This commit is contained in:
Harvey Tindall
2020-08-30 18:09:06 +01:00
parent c6f845296a
commit 1c980cf7cd
4 changed files with 68 additions and 42 deletions
+7 -1
View File
@@ -40,11 +40,17 @@ type Jellyfin struct {
userCache []map[string]interface{}
cacheExpiry time.Time
cacheLength int
noFail bool
}
func (jf *Jellyfin) timeoutHandler() {
if r := recover(); r != nil {
log.Fatalf("Failed to authenticate with Jellyfin @ %s: Timed out", jf.server)
out := fmt.Sprintf("Failed to authenticate with Jellyfin @ %s: Timed out", jf.server)
if jf.noFail {
log.Printf(out)
} else {
log.Fatalf(out)
}
}
}