From 58ca0a9d608596dddb7beed181c473952cf50d31 Mon Sep 17 00:00:00 2001 From: ze0s <43699394+zze0s@users.noreply.github.com> Date: Fri, 22 Sep 2023 19:14:13 +0200 Subject: [PATCH] feat(notifications): Pushover add size (#1143) --- internal/notification/pushover.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/notification/pushover.go b/internal/notification/pushover.go index 6f48f31..b523b49 100644 --- a/internal/notification/pushover.go +++ b/internal/notification/pushover.go @@ -16,6 +16,7 @@ import ( "github.com/autobrr/autobrr/internal/domain" "github.com/autobrr/autobrr/pkg/errors" + "github.com/dustin/go-humanize" "github.com/rs/zerolog" ) @@ -148,6 +149,9 @@ func (s *pushoverSender) buildMessage(payload domain.NotificationPayload) string if payload.ReleaseName != "" { msg += fmt.Sprintf("\nNew release: %v", html.EscapeString(payload.ReleaseName)) } + if payload.Size > 0 { + msg += fmt.Sprintf("\nSize: %v", humanize.Bytes(payload.Size)) + } if payload.Status != "" { msg += fmt.Sprintf("\nStatus: %v", payload.Status.String()) }