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

Closes #4836
pull/4881/head
Mark McDowall 2 years ago
parent 7a0090c7a2
commit 341e8023af

@ -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())

@ -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<EpisodeFile> 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()

@ -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()

@ -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
};

@ -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
};

@ -8,6 +8,7 @@ namespace NzbDrone.Core.Notifications.Webhook
public List<WebhookEpisode> Episodes { get; set; }
public WebhookRelease Release { get; set; }
public string DownloadClient { get; set; }
public string DownloadClientType { get; set; }
public string DownloadId { get; set; }
}
}

@ -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<WebhookEpisodeFile> DeletedFiles { get; set; }
}

Loading…
Cancel
Save