From a3c237dad95e5099b4eb153354f0684066ed4aae Mon Sep 17 00:00:00 2001 From: Bogdan Date: Fri, 21 Jul 2023 01:53:23 +0300 Subject: [PATCH] beyond-hd-api: add search types option --- src/Jackett.Common/Indexers/BeyondHDAPI.cs | 20 +++++++++++++++ .../Bespoke/ConfigurationDataBeyondHDApi.cs | 25 +++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/src/Jackett.Common/Indexers/BeyondHDAPI.cs b/src/Jackett.Common/Indexers/BeyondHDAPI.cs index aa765021d..3b4899b51 100644 --- a/src/Jackett.Common/Indexers/BeyondHDAPI.cs +++ b/src/Jackett.Common/Indexers/BeyondHDAPI.cs @@ -111,18 +111,38 @@ namespace Jackett.Common.Indexers }; if (configData.FilterFreeleech.Value) + { postData.Add(BHDParams.freeleech, "1"); + } + if (configData.FilterLimited.Value) + { postData.Add(BHDParams.limited, "1"); + } + if (configData.FilterRefund.Value) + { postData.Add(BHDParams.refund, "1"); + } + if (configData.FilterRewind.Value) + { postData.Add(BHDParams.rewind, "1"); + } + + if (configData.SearchTypes.Values.Any()) + { + postData.Add(BHDParams.types, string.Join(",", configData.SearchTypes.Values)); + } if (query.IsTVSearch) + { postData.Add(BHDParams.categories, "TV"); + } else if (query.IsMovieSearch) + { postData.Add(BHDParams.categories, "Movies"); + } if (query.IsImdbQuery) { diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataBeyondHDApi.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataBeyondHDApi.cs index 90c57c2db..fe5e9ede3 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataBeyondHDApi.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataBeyondHDApi.cs @@ -1,3 +1,5 @@ +using System; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; namespace Jackett.Common.Models.IndexerConfig.Bespoke @@ -13,6 +15,7 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke public BoolConfigurationItem FilterLimited { get; private set; } public BoolConfigurationItem FilterRefund { get; private set; } public BoolConfigurationItem FilterRewind { get; private set; } + public MultiSelectConfigurationItem SearchTypes { get; private set; } public ConfigurationDataBeyondHDApi(string instructionMessageOptional) { @@ -24,6 +27,28 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke FilterLimited = new BoolConfigurationItem("Filter freeleech (limited UL)"); FilterRefund = new BoolConfigurationItem("Filter refund"); FilterRewind = new BoolConfigurationItem("Filter rewind"); + SearchTypes = new MultiSelectConfigurationItem("Select the types of releases that you are interested in. Leave empty for all.", new Dictionary + { + {"UHD 100", "UHD 100"}, + {"UHD 66", "UHD 66"}, + {"UHD 50", "UHD 50"}, + {"UHD Remux", "UHD Remux"}, + {"BD 50", "BD 50"}, + {"BD 25", "BD 25"}, + {"BD Remux", "BD Remux"}, + {"2160p", "2160p"}, + {"1080p", "1080p"}, + {"1080i", "1080i"}, + {"720p", "720p"}, + {"576p", "576p"}, + {"540p", "540p"}, + {"DVD 9", "DVD 9"}, + {"DVD 5", "DVD 5"}, + {"DVD Remux", "DVD Remux"}, + {"480p", "480p"}, + {"Other", "Other"}, + }) + { Values = Array.Empty() }; } } }