From 549cdbe15a7fef45450d523dfc2aaaed3dac20a4 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 15 Aug 2022 13:31:28 -0700 Subject: [PATCH] New: Add import date to upgraded episodes in CustomScript and Webhook connections Closes #3615 --- src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs | 1 + .../Notifications/Webhook/WebhookEpisodeFile.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs index 6f4b09b3c..41a3a19d8 100644 --- a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs +++ b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs @@ -109,6 +109,7 @@ namespace NzbDrone.Core.Notifications.CustomScript { environmentVariables.Add("Sonarr_DeletedRelativePaths", string.Join("|", message.OldFiles.Select(e => e.RelativePath))); environmentVariables.Add("Sonarr_DeletedPaths", string.Join("|", message.OldFiles.Select(e => Path.Combine(series.Path, e.RelativePath)))); + environmentVariables.Add("Sonarr_DeletedDateAdded", string.Join("|", message.OldFiles.Select(e => e.DateAdded))); } ExecuteScript(environmentVariables); diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFile.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFile.cs index 1da424ef7..35fd8eed1 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFile.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFile.cs @@ -1,4 +1,5 @@ -using NzbDrone.Core.MediaFiles; +using System; +using NzbDrone.Core.MediaFiles; namespace NzbDrone.Core.Notifications.Webhook { @@ -18,6 +19,7 @@ namespace NzbDrone.Core.Notifications.Webhook ReleaseGroup = episodeFile.ReleaseGroup; SceneName = episodeFile.SceneName; Size = episodeFile.Size; + DateAdded = episodeFile.DateAdded; } public int Id { get; set; } @@ -28,5 +30,6 @@ namespace NzbDrone.Core.Notifications.Webhook public string ReleaseGroup { get; set; } public string SceneName { get; set; } public long Size { get; set; } + public DateTime DateAdded { get; set; } } }