mirror of
https://github.com/Sonarr/Sonarr
synced 2025-01-31 03:22:03 +00:00
New: Paths for deleted files when upgrading an existing file
This commit is contained in:
parent
2e392e0f5e
commit
5d9d2e684e
1 changed files with 7 additions and 0 deletions
|
@ -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 a new issue