diff --git a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs index 01e4f3dba..6f4b09b3c 100644 --- a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs +++ b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs @@ -62,7 +62,8 @@ namespace NzbDrone.Core.Notifications.CustomScript environmentVariables.Add("Sonarr_Release_Quality", remoteEpisode.ParsedEpisodeInfo.Quality.Quality.Name); environmentVariables.Add("Sonarr_Release_QualityVersion", remoteEpisode.ParsedEpisodeInfo.Quality.Revision.Version.ToString()); environmentVariables.Add("Sonarr_Release_ReleaseGroup", releaseGroup ?? string.Empty); - environmentVariables.Add("Sonarr_Download_Client", message.DownloadClient ?? string.Empty); + environmentVariables.Add("Sonarr_Download_Client", message.DownloadClientName ?? string.Empty); + environmentVariables.Add("Sonarr_Download_Client_Type", message.DownloadClientType ?? string.Empty); environmentVariables.Add("Sonarr_Download_Id", message.DownloadId ?? string.Empty); ExecuteScript(environmentVariables); @@ -100,7 +101,8 @@ namespace NzbDrone.Core.Notifications.CustomScript environmentVariables.Add("Sonarr_EpisodeFile_SceneName", episodeFile.SceneName ?? string.Empty); environmentVariables.Add("Sonarr_EpisodeFile_SourcePath", sourcePath); environmentVariables.Add("Sonarr_EpisodeFile_SourceFolder", Path.GetDirectoryName(sourcePath)); - environmentVariables.Add("Sonarr_Download_Client", message.DownloadClient ?? string.Empty); + environmentVariables.Add("Sonarr_Download_Client", message.DownloadClientInfo?.Name ?? string.Empty); + environmentVariables.Add("Sonarr_Download_Client_Type", message.DownloadClientInfo?.Type ?? string.Empty); environmentVariables.Add("Sonarr_Download_Id", message.DownloadId ?? string.Empty); if (message.OldFiles.Any()) diff --git a/src/NzbDrone.Core/Notifications/DownloadMessage.cs b/src/NzbDrone.Core/Notifications/DownloadMessage.cs index fb4e7a8ba..619f4f918 100644 --- a/src/NzbDrone.Core/Notifications/DownloadMessage.cs +++ b/src/NzbDrone.Core/Notifications/DownloadMessage.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using NzbDrone.Core.Download; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.Tv; @@ -11,7 +12,7 @@ namespace NzbDrone.Core.Notifications public EpisodeFile EpisodeFile { get; set; } public List OldFiles { 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() diff --git a/src/NzbDrone.Core/Notifications/GrabMessage.cs b/src/NzbDrone.Core/Notifications/GrabMessage.cs index 90688a2c2..bcfe9482b 100644 --- a/src/NzbDrone.Core/Notifications/GrabMessage.cs +++ b/src/NzbDrone.Core/Notifications/GrabMessage.cs @@ -1,4 +1,5 @@ -using NzbDrone.Core.Parser.Model; +using NzbDrone.Core.Download; +using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Qualities; using NzbDrone.Core.Tv; @@ -10,7 +11,8 @@ namespace NzbDrone.Core.Notifications public Series Series { get; set; } public RemoteEpisode Episode { 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() diff --git a/src/NzbDrone.Core/Notifications/NotificationService.cs b/src/NzbDrone.Core/Notifications/NotificationService.cs index 8e469204c..18996a1a4 100644 --- a/src/NzbDrone.Core/Notifications/NotificationService.cs +++ b/src/NzbDrone.Core/Notifications/NotificationService.cs @@ -119,7 +119,8 @@ namespace NzbDrone.Core.Notifications Series = message.Episode.Series, Quality = message.Episode.ParsedEpisodeInfo.Quality, Episode = message.Episode, - DownloadClient = message.DownloadClient, + DownloadClientType = message.DownloadClient, + DownloadClientName = message.DownloadClientName, DownloadId = message.DownloadId }; @@ -152,7 +153,7 @@ namespace NzbDrone.Core.Notifications EpisodeFile = message.ImportedEpisode, OldFiles = message.OldFiles, SourcePath = message.EpisodeInfo.Path, - DownloadClient = message.DownloadClientInfo?.Name, + DownloadClientInfo = message.DownloadClientInfo, DownloadId = message.DownloadId }; diff --git a/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs b/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs index ea5f11ac4..3550fb561 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs @@ -31,7 +31,8 @@ namespace NzbDrone.Core.Notifications.Webhook Series = new WebhookSeries(message.Series), Episodes = remoteEpisode.Episodes.ConvertAll(x => new WebhookEpisode(x)), Release = new WebhookRelease(quality, remoteEpisode), - DownloadClient = message.DownloadClient, + DownloadClient = message.DownloadClientName, + DownloadClientType = message.DownloadClientType, DownloadId = message.DownloadId }; @@ -49,7 +50,8 @@ namespace NzbDrone.Core.Notifications.Webhook Episodes = episodeFile.Episodes.Value.ConvertAll(x => new WebhookEpisode(x)), EpisodeFile = new WebhookEpisodeFile(episodeFile), IsUpgrade = message.OldFiles.Any(), - DownloadClient = message.DownloadClient, + DownloadClient = message.DownloadClientInfo.Name, + DownloadClientType = message.DownloadClientInfo.Type, DownloadId = message.DownloadId }; diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookGrabPayload.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookGrabPayload.cs index 634317728..ebeef36f6 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookGrabPayload.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookGrabPayload.cs @@ -8,6 +8,7 @@ namespace NzbDrone.Core.Notifications.Webhook public List Episodes { get; set; } public WebhookRelease Release { get; set; } public string DownloadClient { get; set; } + public string DownloadClientType { get; set; } public string DownloadId { get; set; } } } diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs index e440e445e..886a45e0f 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs @@ -9,6 +9,7 @@ namespace NzbDrone.Core.Notifications.Webhook public WebhookEpisodeFile EpisodeFile { get; set; } public bool IsUpgrade { get; set; } public string DownloadClient { get; set; } + public string DownloadClientType { get; set; } public string DownloadId { get; set; } public List DeletedFiles { get; set; } }