From 3a9182b6a6a322a03666592f8e08d4afde11ee86 Mon Sep 17 00:00:00 2001 From: jack-mil <62065280+jack-mil@users.noreply.github.com> Date: Mon, 10 Jul 2023 23:50:46 -0400 Subject: [PATCH] New: Add Custom Format fields to Discord On Grab notifications Closes #5769 --- src/NzbDrone.Core/Notifications/Discord/Discord.cs | 8 ++++++++ .../Notifications/Discord/DiscordFieldType.cs | 2 ++ .../Notifications/Discord/DiscordSettings.cs | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Notifications/Discord/Discord.cs b/src/NzbDrone.Core/Notifications/Discord/Discord.cs index 6947feab7..b1ab742ea 100644 --- a/src/NzbDrone.Core/Notifications/Discord/Discord.cs +++ b/src/NzbDrone.Core/Notifications/Discord/Discord.cs @@ -101,6 +101,14 @@ namespace NzbDrone.Core.Notifications.Discord discordField.Name = "Links"; discordField.Value = GetLinksString(series); break; + case DiscordGrabFieldType.CustomFormats: + discordField.Name = "Custom Formats"; + discordField.Value = string.Join("|", message.Episode.CustomFormats); + break; + case DiscordGrabFieldType.CustomFormatScore: + discordField.Name = "Custom Format Score"; + discordField.Value = message.Episode.CustomFormatScore.ToString(); + break; case DiscordGrabFieldType.Indexer: discordField.Name = "Indexer"; discordField.Value = message.Episode.Release.Indexer; diff --git a/src/NzbDrone.Core/Notifications/Discord/DiscordFieldType.cs b/src/NzbDrone.Core/Notifications/Discord/DiscordFieldType.cs index fdc66e708..f51c6a343 100644 --- a/src/NzbDrone.Core/Notifications/Discord/DiscordFieldType.cs +++ b/src/NzbDrone.Core/Notifications/Discord/DiscordFieldType.cs @@ -12,6 +12,8 @@ namespace NzbDrone.Core.Notifications.Discord Release, Poster, Fanart, + CustomFormats, + CustomFormatScore, Indexer } diff --git a/src/NzbDrone.Core/Notifications/Discord/DiscordSettings.cs b/src/NzbDrone.Core/Notifications/Discord/DiscordSettings.cs index 385017cb8..08c427fbf 100644 --- a/src/NzbDrone.Core/Notifications/Discord/DiscordSettings.cs +++ b/src/NzbDrone.Core/Notifications/Discord/DiscordSettings.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Core.Notifications.Discord public DiscordSettings() { // Set Default Fields - GrabFields = new[] { 0, 1, 2, 3, 5, 6, 7, 8, 9 }; + GrabFields = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; ImportFields = new[] { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12 }; ManualInteractionFields = new[] { 0, 1, 2, 3, 5, 6, 7, 8, 9 }; }