add "test" mode for debugging

running with "test" in the arguments will print jellyfin server info,
and try to getUsers.
This commit is contained in:
Harvey Tindall
2020-09-16 11:55:35 +01:00
parent d7fcfe9416
commit e0c4d7c545
2 changed files with 38 additions and 3 deletions

View File

@@ -66,11 +66,13 @@ func pwrMonitor(app *appContext, watcher *fsnotify.Watcher) {
return
}
app.storage.loadEmails()
address, ok := app.storage.emails[user["Id"].(string)].(string)
if !ok {
var address string
addr, ok := app.storage.emails[user["Id"].(string)]
if !ok || addr == nil {
app.err.Printf("Couldn't find email for user \"%s\". Make sure it's set", pwr.Username)
return
}
address = addr.(string)
msg, err := app.email.constructReset(pwr, app)
if err != nil {
app.err.Printf("Failed to construct password reset email for %s", pwr.Username)