From 292986b170869426767a61c577db97f039e94e35 Mon Sep 17 00:00:00 2001 From: Garfield69 Date: Wed, 2 Nov 2022 21:38:44 +1300 Subject: [PATCH] GPW: add option to use torrent filename as title. resolves #13646 add doubanid to results --- src/Jackett.Common/Indexers/GreatPosterWall.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Jackett.Common/Indexers/GreatPosterWall.cs b/src/Jackett.Common/Indexers/GreatPosterWall.cs index 5e9d089d6..b3e322eb5 100644 --- a/src/Jackett.Common/Indexers/GreatPosterWall.cs +++ b/src/Jackett.Common/Indexers/GreatPosterWall.cs @@ -3,12 +3,14 @@ using System.Diagnostics.CodeAnalysis; using System.Net; using System.Text; using System.Threading.Tasks; +using System.Web; using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils; using Newtonsoft.Json.Linq; using NLog; +using static Jackett.Common.Models.IndexerConfig.ConfigurationData; using WebClient = Jackett.Common.Utils.Clients.WebClient; namespace Jackett.Common.Indexers @@ -46,6 +48,8 @@ namespace Jackett.Common.Indexers Type = "private"; AddCategoryMapping(1, TorznabCatType.Movies, "Movies 电影"); + + configData.AddDynamic("showFilename", new BoolConfigurationItem("Use the first torrent filename as the title") { Value = false }); } protected override async Task> PerformQuery(TorznabQuery query) @@ -101,6 +105,13 @@ namespace Jackett.Common.Indexers title.Append(" " + string.Join(" / ", flags)); release.Title = title.ToString(); + + // option to overwrite the title with the first torrent filename #13646 + if (((BoolConfigurationItem)configData.GetDynamic("showFilename")).Value) + release.Title = WebUtility.HtmlDecode((string)torrent["fileName"]); + + release.DoubanId = ParseUtil.GetLongFromString((string)result["doubanId"]); + switch ((string)torrent["freeType"]) { case "11":