Skip to content

Commit

Permalink
chore(lint): fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkness4 committed Dec 6, 2024
1 parent 55c0072 commit b950c7e
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions notify/notify_formated.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,35 +118,35 @@ var DefaultNotificationFormats = NotificationFormats{
}

func (old *NotificationFormat) applyNotificationFormatDefault(
new NotificationFormat,
newFormat NotificationFormat,
) {
if new.Enabled != nil {
old.Enabled = new.Enabled
if newFormat.Enabled != nil {
old.Enabled = newFormat.Enabled
}
if new.Title != "" {
old.Title = new.Title
if newFormat.Title != "" {
old.Title = newFormat.Title
}
if new.Message != "" {
old.Message = new.Message
if newFormat.Message != "" {
old.Message = newFormat.Message
}
if new.Priority != 0 {
old.Priority = new.Priority
if newFormat.Priority != 0 {
old.Priority = newFormat.Priority
}
}

func applyNotificationFormatsDefault(new NotificationFormats) NotificationFormats {
func applyNotificationFormatsDefault(newFormat NotificationFormats) NotificationFormats {
formats := DefaultNotificationFormats
formats.ConfigReloaded.applyNotificationFormatDefault(new.ConfigReloaded)
formats.LoginFailed.applyNotificationFormatDefault(new.LoginFailed)
formats.Panicked.applyNotificationFormatDefault(new.Panicked)
formats.Idle.applyNotificationFormatDefault(new.Idle)
formats.PreparingFiles.applyNotificationFormatDefault(new.PreparingFiles)
formats.Downloading.applyNotificationFormatDefault(new.Downloading)
formats.PostProcessing.applyNotificationFormatDefault(new.PostProcessing)
formats.Finished.applyNotificationFormatDefault(new.Finished)
formats.Error.applyNotificationFormatDefault(new.Error)
formats.Canceled.applyNotificationFormatDefault(new.Canceled)
formats.UpdateAvailable.applyNotificationFormatDefault(new.UpdateAvailable)
formats.ConfigReloaded.applyNotificationFormatDefault(newFormat.ConfigReloaded)
formats.LoginFailed.applyNotificationFormatDefault(newFormat.LoginFailed)
formats.Panicked.applyNotificationFormatDefault(newFormat.Panicked)
formats.Idle.applyNotificationFormatDefault(newFormat.Idle)
formats.PreparingFiles.applyNotificationFormatDefault(newFormat.PreparingFiles)
formats.Downloading.applyNotificationFormatDefault(newFormat.Downloading)
formats.PostProcessing.applyNotificationFormatDefault(newFormat.PostProcessing)
formats.Finished.applyNotificationFormatDefault(newFormat.Finished)
formats.Error.applyNotificationFormatDefault(newFormat.Error)
formats.Canceled.applyNotificationFormatDefault(newFormat.Canceled)
formats.UpdateAvailable.applyNotificationFormatDefault(newFormat.UpdateAvailable)
return formats
}

Expand Down

0 comments on commit b950c7e

Please sign in to comment.