1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-01-02 21:15:05 +00:00

New: Add Custom Format fields to Discord On Grab notifications

(cherry picked from commit 3a9182b6a6a322a03666592f8e08d4afde11ee86)

Closes #3845
Closes #3874
This commit is contained in:
jack-mil 2023-07-10 23:50:46 -04:00 committed by Bogdan
parent c9a5dcf2d3
commit 59bc76ebe0
3 changed files with 13 additions and 3 deletions

View file

@ -101,6 +101,14 @@ public override void OnGrab(GrabMessage message)
discordField.Name = "Links";
discordField.Value = GetLinksString(artist);
break;
case DiscordGrabFieldType.CustomFormats:
discordField.Name = "Custom Formats";
discordField.Value = string.Join("|", message.RemoteAlbum.CustomFormats);
break;
case DiscordGrabFieldType.CustomFormatScore:
discordField.Name = "Custom Format Score";
discordField.Value = message.RemoteAlbum.CustomFormatScore.ToString();
break;
case DiscordGrabFieldType.Indexer:
discordField.Name = "Indexer";
discordField.Value = message.RemoteAlbum.Release.Indexer;

View file

@ -12,7 +12,9 @@ public enum DiscordGrabFieldType
Release,
Poster,
Fanart,
Indexer
Indexer,
CustomFormats,
CustomFormatScore
}
public enum DiscordImportFieldType

View file

@ -19,8 +19,8 @@ public class DiscordSettings : IProviderConfig
public DiscordSettings()
{
// Set Default Fields
GrabFields = new int[] { 0, 1, 2, 3, 5, 6, 7, 8, 9 };
ImportFields = new int[] { 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, 5, 6, 7, 8, 9 };
}
private static readonly DiscordSettingsValidator Validator = new DiscordSettingsValidator();