This commit is contained in:
ponzischeme89
2026-08-27 15:50:15 +12:00
parent 6b2bf767e2
commit 2f4bd0da31
19 changed files with 456 additions and 144 deletions
+10 -2
View File
@@ -131,8 +131,8 @@ func (s *Server) scanSonarrLifecycle(ctx context.Context) (sonarrLifecycleResult
Source: notifySourceSonarrLifecycle,
UserID: user.ID,
Username: user.Username,
Title: "Show cancelled",
Body: change.Current.Title + " has been cancelled.",
Title: cancelledNotificationTitle(change.Current.Title),
Body: cancelledNotificationBody(change.Current.Title),
SourceKey: sourceKey,
EventAt: &eventAt,
Metadata: map[string]any{"series": change.Current.Title, "status": change.Current.Status},
@@ -163,6 +163,14 @@ func sonarrLifecycleNotificationKind(previous, current string) string {
return ""
}
func cancelledNotificationTitle(title string) string {
return strings.TrimSpace(title) + " - Cancelled"
}
func cancelledNotificationBody(title string) string {
return strings.TrimSpace(title) + " has been cancelled by the network."
}
func sonarrSeriesStatusKey(series sonarr.Series) string {
if series.TVDBID > 0 {
return "tvdb:" + strconv.Itoa(series.TVDBID)