diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFile.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFile.cs index 35fd8eed1..84406e8a6 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFile.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFile.cs @@ -20,6 +20,7 @@ namespace NzbDrone.Core.Notifications.Webhook SceneName = episodeFile.SceneName; Size = episodeFile.Size; DateAdded = episodeFile.DateAdded; + MediaInfo = new WebhookEpisodeFileMediaInfo(episodeFile); } public int Id { get; set; } @@ -31,5 +32,6 @@ namespace NzbDrone.Core.Notifications.Webhook public string SceneName { get; set; } public long Size { get; set; } public DateTime DateAdded { get; set; } + public WebhookEpisodeFileMediaInfo MediaInfo { get; set; } } } diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFileMediaInfo.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFileMediaInfo.cs new file mode 100644 index 000000000..a1586d4ce --- /dev/null +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookEpisodeFileMediaInfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using NzbDrone.Core.MediaFiles; +using NzbDrone.Core.MediaFiles.MediaInfo; + +namespace NzbDrone.Core.Notifications.Webhook +{ + public class WebhookEpisodeFileMediaInfo + { + public WebhookEpisodeFileMediaInfo() + { + } + + public WebhookEpisodeFileMediaInfo(EpisodeFile episodeFile) + { + AudioChannels = MediaInfoFormatter.FormatAudioChannels(episodeFile.MediaInfo); + AudioCodec = MediaInfoFormatter.FormatAudioCodec(episodeFile.MediaInfo, episodeFile.SceneName); + AudioLanguages = episodeFile.MediaInfo.AudioLanguages.Distinct().ToList(); + Height = episodeFile.MediaInfo.Height; + Width = episodeFile.MediaInfo.Width; + Subtitles = episodeFile.MediaInfo.Subtitles.Distinct().ToList(); + VideoCodec = MediaInfoFormatter.FormatVideoCodec(episodeFile.MediaInfo, episodeFile.SceneName); + VideoDynamicRange = MediaInfoFormatter.FormatVideoDynamicRange(episodeFile.MediaInfo); + VideoDynamicRangeType = MediaInfoFormatter.FormatVideoDynamicRangeType(episodeFile.MediaInfo); + } + + public decimal AudioChannels { get; set; } + public string AudioCodec { get; set; } + public List AudioLanguages { get; set; } + public int Height { get; set; } + public int Width { get; set; } + public List Subtitles { get; set; } + public string VideoCodec { get; set; } + public string VideoDynamicRange { get; set; } + public string VideoDynamicRangeType { get; set; } + } +} diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookRelease.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookRelease.cs index 836b7cafd..bd825a062 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookRelease.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookRelease.cs @@ -1,4 +1,6 @@ -using NzbDrone.Core.Parser.Model; +using System.Collections.Generic; +using System.Linq; +using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Qualities; namespace NzbDrone.Core.Notifications.Webhook @@ -17,6 +19,8 @@ namespace NzbDrone.Core.Notifications.Webhook ReleaseTitle = remoteEpisode.Release.Title; Indexer = remoteEpisode.Release.Indexer; Size = remoteEpisode.Release.Size; + CustomFormats = remoteEpisode.CustomFormats?.Select(x => x.Name).ToList(); + CustomFormatScore = remoteEpisode.CustomFormatScore; } public string Quality { get; set; } @@ -25,5 +29,7 @@ namespace NzbDrone.Core.Notifications.Webhook public string ReleaseTitle { get; set; } public string Indexer { get; set; } public long Size { get; set; } + public int CustomFormatScore { get; set; } + public List CustomFormats { get; set; } } }