Fixed: Send download client name instead of type for grab events

Closes #7078
This commit is contained in:
Mark McDowall 2022-02-21 20:07:18 -08:00 committed by Qstick
parent 8bb3764708
commit 544e942fe4
8 changed files with 21 additions and 10 deletions

View File

@ -57,7 +57,8 @@ namespace NzbDrone.Core.Notifications.CustomScript
environmentVariables.Add("Radarr_Release_Quality", quality.Quality.Name);
environmentVariables.Add("Radarr_Release_QualityVersion", quality.Revision.Version.ToString());
environmentVariables.Add("Radarr_IndexerFlags", remoteMovie.Release.IndexerFlags.ToString());
environmentVariables.Add("Radarr_Download_Client", message.DownloadClient ?? string.Empty);
environmentVariables.Add("Radarr_Download_Client", message.DownloadClientName ?? string.Empty);
environmentVariables.Add("Radarr_Download_Client_Type", message.DownloadClientType ?? string.Empty);
environmentVariables.Add("Radarr_Download_Id", message.DownloadId ?? string.Empty);
ExecuteScript(environmentVariables);
@ -89,8 +90,9 @@ namespace NzbDrone.Core.Notifications.CustomScript
environmentVariables.Add("Radarr_MovieFile_SceneName", movieFile.SceneName ?? string.Empty);
environmentVariables.Add("Radarr_MovieFile_SourcePath", sourcePath);
environmentVariables.Add("Radarr_MovieFile_SourceFolder", Path.GetDirectoryName(sourcePath));
environmentVariables.Add("Radarr_Download_Client", message.DownloadClientInfo?.Name ?? string.Empty);
environmentVariables.Add("Radarr_Download_Client_Type", message.DownloadClientInfo?.Type ?? string.Empty);
environmentVariables.Add("Radarr_Download_Id", message.DownloadId ?? string.Empty);
environmentVariables.Add("Radarr_Download_Client", message.DownloadClient ?? string.Empty);
if (message.OldMovieFiles.Any())
{

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using NzbDrone.Core.Download;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Movies;
@ -11,7 +12,7 @@ namespace NzbDrone.Core.Notifications
public MovieFile MovieFile { get; set; }
public List<MovieFile> OldMovieFiles { get; set; }
public string SourcePath { get; set; }
public string DownloadClient { get; set; }
public DownloadClientItemClientInfo DownloadClientInfo { get; set; }
public string DownloadId { get; set; }
public override string ToString()

View File

@ -10,7 +10,8 @@ namespace NzbDrone.Core.Notifications
public Movie Movie { get; set; }
public RemoteMovie RemoteMovie { get; set; }
public QualityModel Quality { get; set; }
public string DownloadClient { get; set; }
public string DownloadClientType { get; set; }
public string DownloadClientName { get; set; }
public string DownloadId { get; set; }
public override string ToString()

View File

@ -43,7 +43,8 @@ namespace NzbDrone.Core.Notifications.Notifiarr
variables.Add("Radarr_Release_Quality", quality.Quality.Name);
variables.Add("Radarr_Release_QualityVersion", quality.Revision.Version.ToString());
variables.Add("Radarr_IndexerFlags", remoteMovie.Release.IndexerFlags.ToString());
variables.Add("Radarr_Download_Client", message.DownloadClient ?? string.Empty);
variables.Add("Radarr_Download_Client", message.DownloadClientName ?? string.Empty);
variables.Add("Radarr_Download_Client_Type", message.DownloadClientType ?? string.Empty);
variables.Add("Radarr_Download_Id", message.DownloadId ?? string.Empty);
_proxy.SendNotification(variables, Settings);
@ -76,7 +77,8 @@ namespace NzbDrone.Core.Notifications.Notifiarr
variables.Add("Radarr_MovieFile_SourcePath", sourcePath);
variables.Add("Radarr_MovieFile_SourceFolder", Path.GetDirectoryName(sourcePath));
variables.Add("Radarr_Download_Id", message.DownloadId ?? string.Empty);
variables.Add("Radarr_Download_Client", message.DownloadClient ?? string.Empty);
variables.Add("Radarr_Download_Client", message.DownloadClientInfo?.Name ?? string.Empty);
variables.Add("Radarr_Download_Client_Type", message.DownloadClientInfo?.Type ?? string.Empty);
if (message.OldMovieFiles.Any())
{

View File

@ -95,7 +95,8 @@ namespace NzbDrone.Core.Notifications
Quality = message.Movie.ParsedMovieInfo.Quality,
Movie = message.Movie.Movie,
RemoteMovie = message.Movie,
DownloadClient = message.DownloadClient,
DownloadClientType = message.DownloadClient,
DownloadClientName = message.DownloadClientName,
DownloadId = message.DownloadId
};
@ -131,7 +132,7 @@ namespace NzbDrone.Core.Notifications
Movie = message.MovieInfo.Movie,
OldMovieFiles = message.OldFiles,
SourcePath = message.MovieInfo.Path,
DownloadClient = message.DownloadClientInfo?.Name,
DownloadClientInfo = message.DownloadClientInfo,
DownloadId = message.DownloadId
};

View File

@ -31,7 +31,8 @@ namespace NzbDrone.Core.Notifications.Webhook
Movie = new WebhookMovie(message.Movie),
RemoteMovie = new WebhookRemoteMovie(remoteMovie),
Release = new WebhookRelease(quality, remoteMovie),
DownloadClient = message.DownloadClient,
DownloadClient = message.DownloadClientName,
DownloadClientType = message.DownloadClientType,
DownloadId = message.DownloadId
};
@ -49,7 +50,8 @@ namespace NzbDrone.Core.Notifications.Webhook
RemoteMovie = new WebhookRemoteMovie(message.Movie),
MovieFile = new WebhookMovieFile(movieFile),
IsUpgrade = message.OldMovieFiles.Any(),
DownloadClient = message.DownloadClient,
DownloadClient = message.DownloadClientInfo.Name,
DownloadClientType = message.DownloadClientInfo.Type,
DownloadId = message.DownloadId
};

View File

@ -6,6 +6,7 @@ namespace NzbDrone.Core.Notifications.Webhook
public WebhookRemoteMovie RemoteMovie { get; set; }
public WebhookRelease Release { get; set; }
public string DownloadClient { get; set; }
public string DownloadClientType { get; set; }
public string DownloadId { get; set; }
}
}

View File

@ -9,6 +9,7 @@ namespace NzbDrone.Core.Notifications.Webhook
public WebhookMovieFile MovieFile { get; set; }
public bool IsUpgrade { get; set; }
public string DownloadClient { get; set; }
public string DownloadClientType { get; set; }
public string DownloadId { get; set; }
public List<WebhookMovieFile> DeletedFiles { get; set; }
}