From a31ca4e80b8015804d70104f824afa86b40f1461 Mon Sep 17 00:00:00 2001 From: Daniel Martin Gonzalez Date: Tue, 11 May 2021 19:15:14 +0200 Subject: [PATCH] New: Telegram Notification - Add Upgrade Movie Support --- src/NzbDrone.Core/Notifications/NotificationBase.cs | 1 + src/NzbDrone.Core/Notifications/Telegram/Telegram.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Notifications/NotificationBase.cs b/src/NzbDrone.Core/Notifications/NotificationBase.cs index 505bc5681..26e5b994a 100644 --- a/src/NzbDrone.Core/Notifications/NotificationBase.cs +++ b/src/NzbDrone.Core/Notifications/NotificationBase.cs @@ -12,6 +12,7 @@ namespace NzbDrone.Core.Notifications { protected const string MOVIE_GRABBED_TITLE = "Movie Grabbed"; protected const string MOVIE_DOWNLOADED_TITLE = "Movie Downloaded"; + protected const string MOVIE_UPGRADED_TITLE = "Movie Upgraded"; protected const string MOVIE_DELETED_TITLE = "Movie Deleted"; protected const string MOVIE_FILE_DELETED_TITLE = "Movie File Deleted"; protected const string HEALTH_ISSUE_TITLE = "Health Check Failure"; diff --git a/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs b/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs index c91c8077f..401c10f1b 100644 --- a/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs +++ b/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using FluentValidation.Results; using NzbDrone.Common.Extensions; @@ -23,7 +24,14 @@ namespace NzbDrone.Core.Notifications.Telegram public override void OnDownload(DownloadMessage message) { - _proxy.SendNotification(MOVIE_DOWNLOADED_TITLE, message.Message, Settings); + if (message.OldMovieFiles.Any()) + { + _proxy.SendNotification(MOVIE_UPGRADED_TITLE, message.Message, Settings); + } + else + { + _proxy.SendNotification(MOVIE_DOWNLOADED_TITLE, message.Message, Settings); + } } public override void OnMovieFileDelete(MovieFileDeleteMessage deleteMessage)