mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(notifications): Telegram display file size (#1148)
This commit is contained in:
parent
25c3f02c72
commit
657c966ecb
1 changed files with 4 additions and 0 deletions
|
@ -17,6 +17,7 @@ import (
|
|||
"github.com/autobrr/autobrr/internal/domain"
|
||||
"github.com/autobrr/autobrr/pkg/errors"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
|
@ -135,6 +136,9 @@ func (s *telegramSender) buildMessage(event domain.NotificationEvent, payload do
|
|||
if payload.ReleaseName != "" {
|
||||
msg += fmt.Sprintf("\n<b>New release:</b> %v", html.EscapeString(payload.ReleaseName))
|
||||
}
|
||||
if payload.Size > 0 {
|
||||
msg += fmt.Sprintf("\n<b>File Size:</b> %v", html.EscapeString(humanize.Bytes(payload.Size)))
|
||||
}
|
||||
if payload.Status != "" {
|
||||
msg += fmt.Sprintf("\n<b>Status:</b> %v", payload.Status.String())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue