1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-25 22:37:27 -04:00

New: OnApplicationUpdate Notifications (#6854)

Fixes #4681
[common]
This commit is contained in:
Qstick
2021-12-20 23:12:12 -06:00
committed by GitHub
parent 4d2a311e40
commit 9e175e28ef
35 changed files with 293 additions and 5 deletions
@@ -10,6 +10,7 @@ using NzbDrone.Core.Movies;
using NzbDrone.Core.Movies.Events;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Update.History.Events;
namespace NzbDrone.Core.Notifications
{
@@ -20,6 +21,7 @@ namespace NzbDrone.Core.Notifications
IHandle<MoviesDeletedEvent>,
IHandle<MovieFileDeletedEvent>,
IHandle<HealthCheckFailedEvent>,
IHandle<UpdateInstalledEvent>,
IHandleAsync<DeleteCompletedEvent>,
IHandleAsync<DownloadsProcessedEvent>,
IHandleAsync<RenameCompletedEvent>,
@@ -162,6 +164,26 @@ namespace NzbDrone.Core.Notifications
}
}
public void Handle(UpdateInstalledEvent message)
{
var updateMessage = new ApplicationUpdateMessage();
updateMessage.Message = $"Radarr updated from {message.PreviousVerison.ToString()} to {message.NewVersion.ToString()}";
updateMessage.PreviousVersion = message.PreviousVerison;
updateMessage.NewVersion = message.NewVersion;
foreach (var notification in _notificationFactory.OnApplicationUpdateEnabled())
{
try
{
notification.OnApplicationUpdate(updateMessage);
}
catch (Exception ex)
{
_logger.Warn(ex, "Unable to send OnApplicationUpdate notification to: " + notification.Definition.Name);
}
}
}
public void Handle(MovieFileDeletedEvent message)
{
var deleteMessage = new MovieFileDeleteMessage();