From cbc14a1a2c600fcddd071253ff2460c53862ae2b Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 3 Apr 2021 11:56:09 -0400 Subject: [PATCH] New: Make Rarbg category selection more intuitive [common] Fixes #6138 Fixes #6139 --- .../Indexers/Rarbg/RarbgSettings.cs | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Rarbg/RarbgSettings.cs b/src/NzbDrone.Core/Indexers/Rarbg/RarbgSettings.cs index f7ae26cf9..8f344eb79 100644 --- a/src/NzbDrone.Core/Indexers/Rarbg/RarbgSettings.cs +++ b/src/NzbDrone.Core/Indexers/Rarbg/RarbgSettings.cs @@ -28,7 +28,19 @@ public RarbgSettings() BaseUrl = "https://torrentapi.org"; RankedOnly = false; MinimumSeeders = IndexerDefaults.MINIMUM_SEEDERS; - Categories = new[] { 14, 48, 17, 44, 45, 47, 50, 51, 52, 42, 46 }; + Categories = new int[] + { + (int)RarbgCategories.Movie_Xvid, + (int)RarbgCategories.Movie_Xvid_720p, + (int)RarbgCategories.Movie_x264, + (int)RarbgCategories.Movie_x264_720p, + (int)RarbgCategories.Movie_x264_1080p, + (int)RarbgCategories.Movie_x264_4K, + (int)RarbgCategories.Movie_x265_1080p, + (int)RarbgCategories.Movie_x265_4K, + (int)RarbgCategories.Movie_x265_4K_HDR, + (int)RarbgCategories.Movie_BD_Remux + }; MultiLanguages = new List(); RequiredFlags = new List(); } @@ -51,7 +63,7 @@ public RarbgSettings() [FieldDefinition(5, Type = FieldType.TagSelect, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://wiki.servarr.com/Definitions#Indexer_Flags", Advanced = true)] public IEnumerable RequiredFlags { get; set; } - [FieldDefinition(6, Type = FieldType.Textbox, Label = "Categories", HelpText = "Comma Separated list, you can retrieve the ID by checking the URL behind the category on the website (i.e. Movie/x264/1080 = 44)", HelpLink = "https://rarbgmirror.org/torrents.php?category=movies", Advanced = true)] + [FieldDefinition(6, Type = FieldType.Select, Label = "Categories", SelectOptions = typeof(RarbgCategories), HelpText = "Categories for use in search and feeds. If unspecified, all options are used.", Advanced = true)] public IEnumerable Categories { get; set; } [FieldDefinition(7)] @@ -62,4 +74,34 @@ public NzbDroneValidationResult Validate() return new NzbDroneValidationResult(Validator.Validate(this)); } } + + public enum RarbgCategories + { + [FieldOption] + Movie_Xvid = 14, + [FieldOption] + Movie_Xvid_720p = 48, + [FieldOption] + Movie_x264 = 17, + [FieldOption] + Movie_x264_720p = 45, + [FieldOption] + Movie_x264_1080p = 44, + [FieldOption] + Movie_x264_4K = 50, + [FieldOption] + Movie_x264_3D = 47, + [FieldOption] + Movie_x265_1080p = 54, + [FieldOption] + Movie_x265_4K = 51, + [FieldOption] + Movie_x265_4K_HDR = 52, + [FieldOption] + Movie_BD_Remux = 46, + [FieldOption] + Movie_Full_BD = 42, + [FieldOption] + XXX = 4, + } }