Skip to content

Commit 7a71c33

Browse files
committedDec 31, 2023
Fixed: Improve field selection for Discord settings
Closes #4387
1 parent 2109d17 commit 7a71c33

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed
 

‎src/NzbDrone.Core/Notifications/Discord/DiscordSettings.cs

+32-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,38 @@ public class DiscordSettings : IProviderConfig
1919
public DiscordSettings()
2020
{
2121
// Set Default Fields
22-
GrabFields = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
23-
ImportFields = new[] { 0, 1, 2, 3, 5, 6, 7, 8, 9 };
22+
GrabFields = new[]
23+
{
24+
(int)DiscordGrabFieldType.Overview,
25+
(int)DiscordGrabFieldType.Rating,
26+
(int)DiscordGrabFieldType.Genres,
27+
(int)DiscordGrabFieldType.Quality,
28+
(int)DiscordGrabFieldType.Group,
29+
(int)DiscordGrabFieldType.Size,
30+
(int)DiscordGrabFieldType.Links,
31+
(int)DiscordGrabFieldType.Release,
32+
(int)DiscordGrabFieldType.Poster,
33+
(int)DiscordGrabFieldType.Fanart,
34+
(int)DiscordGrabFieldType.Indexer,
35+
(int)DiscordGrabFieldType.CustomFormats,
36+
(int)DiscordGrabFieldType.CustomFormatScore
37+
};
38+
ImportFields = new[]
39+
{
40+
(int)DiscordImportFieldType.Overview,
41+
(int)DiscordImportFieldType.Rating,
42+
(int)DiscordImportFieldType.Genres,
43+
(int)DiscordImportFieldType.Quality,
44+
(int)DiscordImportFieldType.Group,
45+
(int)DiscordImportFieldType.Size,
46+
(int)DiscordImportFieldType.Links,
47+
(int)DiscordImportFieldType.Release,
48+
(int)DiscordImportFieldType.Poster,
49+
(int)DiscordImportFieldType.Fanart
50+
};
2451
}
2552

26-
private static readonly DiscordSettingsValidator Validator = new DiscordSettingsValidator();
53+
private static readonly DiscordSettingsValidator Validator = new ();
2754

2855
[FieldDefinition(0, Label = "Webhook URL", HelpText = "Discord channel webhook url")]
2956
public string WebHookUrl { get; set; }
@@ -37,10 +64,10 @@ public DiscordSettings()
3764
[FieldDefinition(3, Label = "Host", Advanced = true, HelpText = "Override the Host that shows for this notification, Blank is machine name", Type = FieldType.Textbox)]
3865
public string Author { get; set; }
3966

40-
[FieldDefinition(4, Label = "On Grab Fields", Advanced = true, SelectOptions = typeof(DiscordGrabFieldType), HelpText = "Change the fields that are passed in for this 'on grab' notification", Type = FieldType.TagSelect)]
67+
[FieldDefinition(4, Label = "On Grab Fields", Advanced = true, SelectOptions = typeof(DiscordGrabFieldType), HelpText = "Change the fields that are passed in for this 'on grab' notification", Type = FieldType.Select)]
4168
public IEnumerable<int> GrabFields { get; set; }
4269

43-
[FieldDefinition(5, Label = "On Import Fields", Advanced = true, SelectOptions = typeof(DiscordImportFieldType), HelpText = "Change the fields that are passed for this 'on import' notification", Type = FieldType.TagSelect)]
70+
[FieldDefinition(5, Label = "On Import Fields", Advanced = true, SelectOptions = typeof(DiscordImportFieldType), HelpText = "Change the fields that are passed for this 'on import' notification", Type = FieldType.Select)]
4471
public IEnumerable<int> ImportFields { get; set; }
4572

4673
public NzbDroneValidationResult Validate()

0 commit comments

Comments
 (0)
Please sign in to comment.