passthepopcorn: add release attributes in the title as opt-in

This commit is contained in:
Bogdan 2023-11-19 21:04:19 +02:00
parent 4e6b29efcd
commit c5e7d161ef
2 changed files with 16 additions and 3 deletions

View File

@ -265,9 +265,15 @@ namespace Jackett.Common.Indexers
var otherTags = (string)torrent["RemasterTitle"];
if (year != null)
{
release.Description += $"<br>\nYear: {year}";
}
if (quality != null)
{
release.Description += $"<br>\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);
}

View File

@ -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", "<ul><li>Visit the security tab on your user settings page to access your ApiUser and ApiKey <li>If you haven't yet generated a key, you may have to first generate one using the checkbox below your keys</ul>");
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)");
}
}