jellyseer: auto-null NotifTypes field

changed to a pointer so it can be nil-ed, and an Empty() receiver method
is used to check if it needs it in ApplyNotificationsTemplateToUser.
This commit is contained in:
Harvey Tindall
2024-07-30 16:49:35 +01:00
parent a97bccc88f
commit 769a7c45da
2 changed files with 15 additions and 8 deletions
+3
View File
@@ -356,6 +356,9 @@ func (js *Jellyseerr) GetNotificationPreferencesByID(jellyseerrID int64) (Notifi
}
func (js *Jellyseerr) ApplyNotificationsTemplateToUser(jfID string, tmpl NotificationsTemplate) error {
if tmpl.NotifTypes.Empty() {
tmpl.NotifTypes = nil
}
u, err := js.MustGetUser(jfID)
if err != nil {
return err