From cbff3085fa271c423a5b06cd5457166c0f110dd7 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Fri, 28 Nov 2025 20:37:45 +0000 Subject: [PATCH] profiles: "add jellyseerr" checkbox on profile creation makes things clearer to new users. Fixes #438. --- api-jellyseerr.go | 2 +- api-profiles.go | 15 +++++++++++++++ css/base.css | 2 +- html/admin.html | 25 ++++++++++++++++--------- lang/admin/en-us.json | 1 + models.go | 1 + ts/modules/profiles.ts | 3 +++ 7 files changed, 38 insertions(+), 11 deletions(-) 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 @@