From c5e7d161efba1589ee772da7ac5a30dce50e2644 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 19 Nov 2023 21:04:19 +0200 Subject: [PATCH] passthepopcorn: add release attributes in the title as opt-in --- src/Jackett.Common/Indexers/PassThePopcorn.cs | 12 +++++++++++- ...urationDataAPILoginWithUserAndPasskeyAndFilter.cs | 7 +++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Jackett.Common/Indexers/PassThePopcorn.cs b/src/Jackett.Common/Indexers/PassThePopcorn.cs index feddc4564..cdb955e18 100644 --- a/src/Jackett.Common/Indexers/PassThePopcorn.cs +++ b/src/Jackett.Common/Indexers/PassThePopcorn.cs @@ -265,9 +265,15 @@ namespace Jackett.Common.Indexers var otherTags = (string)torrent["RemasterTitle"]; if (year != null) + { release.Description += $"
\nYear: {year}"; + } + if (quality != null) + { release.Description += $"
\nQuality: {quality}"; + } + if (resolution != null) { titleTags.Add(resolution); @@ -305,10 +311,14 @@ namespace Jackett.Common.Indexers } if (otherTags != null) + { titleTags.Add(otherTags); + } - if (titleTags.Any()) + if (configData.AddAttributesToTitle.Value && titleTags.Any()) + { release.Title += " [" + string.Join(" / ", titleTags) + "]"; + } releases.Add(release); } diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs index c9d314689..6ba12878d 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs @@ -5,16 +5,19 @@ namespace Jackett.Common.Models.IndexerConfig public DisplayInfoConfigurationItem KeyHint { get; private set; } public StringConfigurationItem User { get; private set; } public StringConfigurationItem Key { get; private set; } + public BoolConfigurationItem AddAttributesToTitle { get; private set; } public DisplayInfoConfigurationItem FilterExample { get; private set; } public StringConfigurationItem FilterString { get; private set; } - public ConfigurationDataAPILoginWithUserAndPasskeyAndFilter(string FilterInstructions) + public ConfigurationDataAPILoginWithUserAndPasskeyAndFilter(string filterInstructions) { KeyHint = new DisplayInfoConfigurationItem("API Authentication", ""); User = new StringConfigurationItem("ApiUser") { Value = string.Empty }; Key = new StringConfigurationItem("ApiKey") { Value = string.Empty }; - FilterExample = new DisplayInfoConfigurationItem("", FilterInstructions); + AddAttributesToTitle = new BoolConfigurationItem("Include release attributes in the title") { Value = false }; + + FilterExample = new DisplayInfoConfigurationItem("", filterInstructions); FilterString = new StringConfigurationItem("Filters (optional)"); } }