mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-30 07:22:35 +01:00
New: Paths for deleted files when upgrading an existing file
This commit is contained in:
parent
2e392e0f5e
commit
5d9d2e684e
@ -64,6 +64,7 @@ namespace NzbDrone.Core.Notifications.CustomScript
|
||||
var environmentVariables = new StringDictionary();
|
||||
|
||||
environmentVariables.Add("Sonarr_EventType", "Download");
|
||||
environmentVariables.Add("Sonarr_IsUpgrade", message.OldFiles.Any().ToString());
|
||||
environmentVariables.Add("Sonarr_Series_Id", series.Id.ToString());
|
||||
environmentVariables.Add("Sonarr_Series_Title", series.Title);
|
||||
environmentVariables.Add("Sonarr_Series_Path", series.Path);
|
||||
@ -85,6 +86,12 @@ namespace NzbDrone.Core.Notifications.CustomScript
|
||||
environmentVariables.Add("Sonarr_EpisodeFile_SourcePath", sourcePath);
|
||||
environmentVariables.Add("Sonarr_EpisodeFile_SourceFolder", Path.GetDirectoryName(sourcePath));
|
||||
|
||||
if (message.OldFiles.Any())
|
||||
{
|
||||
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))));
|
||||
}
|
||||
|
||||
ExecuteScript(environmentVariables);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user