From 8861c8d8a4af307c5163039d4f39c9aad0b0b98d Mon Sep 17 00:00:00 2001 From: fhscholl Date: Sun, 22 Oct 2017 20:49:37 -0400 Subject: [PATCH] Add IsUpgrade and related deleted file paths for CustomScript (#2205) * Add IsUpgrade flag and deleted file paths for updates * use OldMovieFiles instead of OldFiles --- .../Notifications/CustomScript/CustomScript.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs index dda6e2e6d..ffdc075d4 100644 --- a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs +++ b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs @@ -54,6 +54,7 @@ namespace NzbDrone.Core.Notifications.CustomScript var environmentVariables = new StringDictionary(); environmentVariables.Add("Radarr_EventType", "Download"); + environmentVariables.Add("Radarr_IsUpgrade", message.OldMovieFiles.Any().ToString()); environmentVariables.Add("Radarr_Movie_Id", movie.Id.ToString()); environmentVariables.Add("Radarr_Movie_Title", movie.Title); environmentVariables.Add("Radarr_Movie_Path", movie.Path); @@ -69,6 +70,11 @@ namespace NzbDrone.Core.Notifications.CustomScript environmentVariables.Add("Radarr_MovieFile_SourcePath", sourcePath); environmentVariables.Add("Radarr_MovieFile_SourceFolder", Path.GetDirectoryName(sourcePath)); + if (message.OldMovieFiles.Any()) + { + environmentVariables.Add("Radarr_DeletedRelativePaths", string.Join("|", message.OldMovieFiles.Select(e => e.RelativePath))); + environmentVariables.Add("Radarr_DeletedPaths", string.Join("|", message.OldMovieFiles.Select(e => Path.Combine(movie.Path, e.RelativePath)))); + } ExecuteScript(environmentVariables); }