form: functional "collect on sign-up" setting

was added without functionality by accident in a7aa3fd. This commit adds
the functionality in. Probably some other fixes too.
This commit is contained in:
Harvey Tindall
2025-11-27 17:53:01 +00:00
parent d7e4431bd8
commit 073772ad60
7 changed files with 47 additions and 25 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"strconv"
"strings"
"time"
"github.com/hrfee/jfa-go/jellyseerr"
@@ -28,7 +29,12 @@ func (app *appContext) SynchronizeJellyseerrUser(jfID string) {
if ok && email.Addr != "" && user.Email != email.Addr {
err = app.js.ModifyMainUserSettings(jfID, jellyseerr.MainUserSettings{Email: email.Addr})
if err != nil {
app.err.Printf(lm.FailedSetEmailAddress, lm.Jellyseerr, jfID, err)
if strings.Contains(err.Error(), "INVALID_EMAIL") {
app.err.Printf(lm.FailedSetEmailAddress, lm.Jellyseerr, jfID, err.Error()+"\""+email.Addr+"\"")
} else {
app.err.Printf(lm.FailedSetEmailAddress, lm.Jellyseerr, jfID, err)
}
} else {
contactMethods[jellyseerr.FieldEmailEnabled] = email.Contact
}