From d15c42957a981b10589904a66ebc7458dbe830f4 Mon Sep 17 00:00:00 2001 From: Qstick Date: Wed, 25 Jan 2023 22:02:47 -0600 Subject: [PATCH] New: Add import date to upgrads in CustomScript and Webhook connections Closes #1827 --- src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs | 1 + src/NzbDrone.Core/Notifications/Webhook/WebhookBookFile.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs index d3f3aae47..89b52a223 100644 --- a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs +++ b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs @@ -88,6 +88,7 @@ namespace NzbDrone.Core.Notifications.CustomScript if (message.OldFiles.Any()) { environmentVariables.Add("Readarr_DeletedPaths", string.Join("|", message.OldFiles.Select(e => e.Path))); + environmentVariables.Add("Readarr_DeletedDateAdded", string.Join("|", message.OldFiles.Select(e => e.DateAdded))); } ExecuteScript(environmentVariables); diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookBookFile.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookBookFile.cs index 140f027e7..468ad37f8 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookBookFile.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookBookFile.cs @@ -1,3 +1,4 @@ +using System; using NzbDrone.Core.MediaFiles; namespace NzbDrone.Core.Notifications.Webhook @@ -16,6 +17,8 @@ namespace NzbDrone.Core.Notifications.Webhook QualityVersion = bookFile.Quality.Revision.Version; ReleaseGroup = bookFile.ReleaseGroup; SceneName = bookFile.SceneName; + Size = bookFile.Size; + DateAdded = bookFile.DateAdded; } public int Id { get; set; } @@ -24,5 +27,7 @@ namespace NzbDrone.Core.Notifications.Webhook public int QualityVersion { get; set; } public string ReleaseGroup { get; set; } public string SceneName { get; set; } + public long Size { get; set; } + public DateTime DateAdded { get; set; } } }