mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
anilibria: add option to append RUS to title #5762
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Net;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AngleSharp;
|
using AngleSharp;
|
||||||
|
using Autofac.Core;
|
||||||
using Jackett.Common.Helpers;
|
using Jackett.Common.Helpers;
|
||||||
using Jackett.Common.Models;
|
using Jackett.Common.Models;
|
||||||
using Jackett.Common.Models.DTO.Anilibria;
|
using Jackett.Common.Models.DTO.Anilibria;
|
||||||
@@ -34,6 +35,7 @@ namespace Jackett.Common.Indexers.Definitions
|
|||||||
public override string Language => "ru-RU";
|
public override string Language => "ru-RU";
|
||||||
public override string Type => "public";
|
public override string Type => "public";
|
||||||
public override TorznabCapabilities TorznabCaps => SetCapabilities();
|
public override TorznabCapabilities TorznabCaps => SetCapabilities();
|
||||||
|
private ConfigurationDataAnilibria ConfigData => (ConfigurationDataAnilibria)configData;
|
||||||
|
|
||||||
public Anilibria(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
|
public Anilibria(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
|
||||||
ICacheService cs) : base(
|
ICacheService cs) : base(
|
||||||
@@ -111,12 +113,14 @@ namespace Jackett.Common.Indexers.Definitions
|
|||||||
torrents.ContentString, new AnilibriaTopTorrentInfoConverter()));
|
torrents.ContentString, new AnilibriaTopTorrentInfoConverter()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var AddRusTag = (ConfigData.AddRussianToTitle.Value) ? " RUS" : string.Empty;
|
||||||
|
|
||||||
releases.AddRange(
|
releases.AddRange(
|
||||||
torrentsInfo.Select(
|
torrentsInfo.Select(
|
||||||
torrentInfo => new ReleaseInfo
|
torrentInfo => new ReleaseInfo
|
||||||
{
|
{
|
||||||
Guid = GetGuidLink(torrentInfo.Alias, torrentInfo.Hash),
|
Guid = GetGuidLink(torrentInfo.Alias, torrentInfo.Hash),
|
||||||
Title = $"{torrentInfo.NameMain} / {torrentInfo.Label}",
|
Title = $"{torrentInfo.NameMain} / {torrentInfo.Label}{AddRusTag}",
|
||||||
Details = GetReleaseLink(torrentInfo.Alias),
|
Details = GetReleaseLink(torrentInfo.Alias),
|
||||||
Poster = GetPosterLink(torrentInfo.PosterSrc),
|
Poster = GetPosterLink(torrentInfo.PosterSrc),
|
||||||
Year = torrentInfo.Year,
|
Year = torrentInfo.Year,
|
||||||
|
@@ -2,5 +2,11 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
{
|
{
|
||||||
public class ConfigurationDataAnilibria : ConfigurationData
|
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 };
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user