anilibria: add option to append RUS to title #5762

This commit is contained in:
Garfield69
2025-06-29 14:56:04 +12:00
parent fd2d0a9e96
commit eda7f5966d
2 changed files with 11 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ using System.Net;
using System.Text;
using System.Threading.Tasks;
using AngleSharp;
using Autofac.Core;
using Jackett.Common.Helpers;
using Jackett.Common.Models;
using Jackett.Common.Models.DTO.Anilibria;
@@ -34,6 +35,7 @@ namespace Jackett.Common.Indexers.Definitions
public override string Language => "ru-RU";
public override string Type => "public";
public override TorznabCapabilities TorznabCaps => SetCapabilities();
private ConfigurationDataAnilibria ConfigData => (ConfigurationDataAnilibria)configData;
public Anilibria(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
ICacheService cs) : base(
@@ -111,12 +113,14 @@ namespace Jackett.Common.Indexers.Definitions
torrents.ContentString, new AnilibriaTopTorrentInfoConverter()));
}
var AddRusTag = (ConfigData.AddRussianToTitle.Value) ? " RUS" : string.Empty;
releases.AddRange(
torrentsInfo.Select(
torrentInfo => new ReleaseInfo
{
Guid = GetGuidLink(torrentInfo.Alias, torrentInfo.Hash),
Title = $"{torrentInfo.NameMain} / {torrentInfo.Label}",
Title = $"{torrentInfo.NameMain} / {torrentInfo.Label}{AddRusTag}",
Details = GetReleaseLink(torrentInfo.Alias),
Poster = GetPosterLink(torrentInfo.PosterSrc),
Year = torrentInfo.Year,

View File

@@ -2,5 +2,11 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
{
public class ConfigurationDataAnilibria : ConfigurationData
{
public BoolConfigurationItem AddRussianToTitle { get; private set; }
public ConfigurationDataAnilibria()
{
AddRussianToTitle = new BoolConfigurationItem("Add RUS to end of all titles to improve language detection by Sonarr and Radarr. Will cause English-only results to be misidentified.") { Value = false };
}
}
}