cleanup logs and use structs in jf/emby api

Also means times are directly parsed when pulling data from jf/emby,
which was *painful* to get working (something broke the whole program and it
took me an hour to figure out it was this lol). Time parsing should be a
lot stabler too.
This commit is contained in:
Harvey Tindall
2021-02-19 00:47:01 +00:00
parent ce30537ebd
commit 76fa171575
9 changed files with 303 additions and 210 deletions
+3 -4
View File
@@ -70,13 +70,12 @@ func pwrMonitor(app *appContext, watcher *fsnotify.Watcher) {
}
app.storage.loadEmails()
var address string
uid := user["Id"]
if uid == nil {
uid := user.ID
if uid == "" {
app.err.Printf("Couldn't get user ID for user \"%s\"", pwr.Username)
app.debug.Printf("user maplength: %d", len(user))
return
}
addr, ok := app.storage.emails[user["Id"].(string)]
addr, ok := app.storage.emails[uid]
if !ok || addr == nil {
app.err.Printf("Couldn't find email for user \"%s\". Make sure it's set", pwr.Username)
return