diff --git a/api-jellyseerr.go b/api-jellyseerr.go index 485409c..927463a 100644 --- a/api-jellyseerr.go +++ b/api-jellyseerr.go @@ -62,7 +62,7 @@ func (app *appContext) SetJellyseerrProfile(gc *gin.Context) { } u, err := app.js.UserByID(jellyseerrID) if err != nil { - app.err.Printf(lm.FailedGetUsers, lm.Jellyseerr, err) + app.err.Printf(lm.FailedGetUser, jellyseerrID, lm.Jellyseerr, err) respond(500, "Couldn't get user", gc) return } diff --git a/api-profiles.go b/api-profiles.go index 1a710ad..b02bf32 100644 --- a/api-profiles.go +++ b/api-profiles.go @@ -196,6 +196,21 @@ func (app *appContext) CreateProfile(gc *gin.Context) { return } } + if req.Jellyseerr && app.config.Section("jellyseerr").Key("enabled").MustBool(false) { + user, err := app.js.MustGetUser(req.ID) + if err != nil { + app.err.Printf(lm.FailedGetUser, user.Name, lm.Jellyseerr, err) + } else { + profile.Jellyseerr.User = user.UserTemplate + n, err := app.js.GetNotificationPreferencesByID(user.ID) + if err != nil { + app.err.Printf(lm.FailedGetJellyseerrNotificationPrefs, user.ID, err) + } else { + profile.Jellyseerr.Notifications = n.NotificationsTemplate + profile.Jellyseerr.Enabled = true + } + } + } app.storage.SetProfileKey(req.Name, profile) // Refresh discord bots, profile list if discordEnabled { diff --git a/css/base.css b/css/base.css index ea5ff77..d88d34a 100644 --- a/css/base.css +++ b/css/base.css @@ -459,7 +459,7 @@ section.section:not(.\~neutral) { @layer components { .switch { - @apply flex flex-row gap-1 items-center; + @apply flex flex-row gap-2 items-center; } } diff --git a/html/admin.html b/html/admin.html index 2d7c7b5..78cc93d 100644 --- a/html/admin.html +++ b/html/admin.html @@ -467,25 +467,32 @@