mirror of
https://github.com/Jackett/Jackett.git
synced 2025-10-02 08:34:32 +02:00
rutracker: add option to append RUS to movies/tv shows titles (#14018)
This commit is contained in:
@@ -1578,7 +1578,8 @@ namespace Jackett.Common.Indexers
|
|||||||
category,
|
category,
|
||||||
configData.StripRussianLetters.Value,
|
configData.StripRussianLetters.Value,
|
||||||
configData.MoveAllTagsToEndOfReleaseTitle.Value,
|
configData.MoveAllTagsToEndOfReleaseTitle.Value,
|
||||||
configData.MoveFirstTagsToEndOfReleaseTitle.Value
|
configData.MoveFirstTagsToEndOfReleaseTitle.Value,
|
||||||
|
configData.AddRussianToTitle.Value
|
||||||
),
|
),
|
||||||
Description = title,
|
Description = title,
|
||||||
Details = details,
|
Details = details,
|
||||||
@@ -1647,7 +1648,12 @@ namespace Jackett.Common.Indexers
|
|||||||
private readonly Regex _tvTitleRusEpisodeOfRegex = new Regex(@"(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)\s*из\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
private readonly Regex _tvTitleRusEpisodeOfRegex = new Regex(@"(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)\s*из\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||||
private readonly Regex _tvTitleRusEpisodeRegex = new Regex(@"(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
private readonly Regex _tvTitleRusEpisodeRegex = new Regex(@"(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
public string Parse(string title, ICollection<int> category, bool stripCyrillicLetters = true, bool moveAllTagsToEndOfReleaseTitle = false, bool moveFirstTagsToEndOfReleaseTitle = false)
|
public string Parse(string title,
|
||||||
|
ICollection<int> category,
|
||||||
|
bool stripCyrillicLetters = true,
|
||||||
|
bool moveAllTagsToEndOfReleaseTitle = false,
|
||||||
|
bool moveFirstTagsToEndOfReleaseTitle = false,
|
||||||
|
bool addRussianToTitle = false)
|
||||||
{
|
{
|
||||||
// https://www.fileformat.info/info/unicode/category/Pd/list.htm
|
// https://www.fileformat.info/info/unicode/category/Pd/list.htm
|
||||||
title = Regex.Replace(title, @"\p{Pd}", "-", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
title = Regex.Replace(title, @"\p{Pd}", "-", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||||
@@ -1676,12 +1682,12 @@ namespace Jackett.Common.Indexers
|
|||||||
|
|
||||||
// Bluray quality fix: radarr parse Blu-ray Disc as Bluray-1080p but should be BR-DISK
|
// Bluray quality fix: radarr parse Blu-ray Disc as Bluray-1080p but should be BR-DISK
|
||||||
title = Regex.Replace(title, @"\bBlu-ray Disc\b", "BR-DISK", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
title = Regex.Replace(title, @"\bBlu-ray Disc\b", "BR-DISK", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
// language fix: all rutracker releases contains russian track
|
|
||||||
if (title.IndexOf("rus", StringComparison.OrdinalIgnoreCase) < 0)
|
|
||||||
title += " rus";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// language fix: all rutracker releases contains russian track
|
||||||
|
if (addRussianToTitle && (IsAnyTvCategory(category) || IsAnyMovieCategory(category)) && !Regex.Match(title, "\bRUS\b", RegexOptions.IgnoreCase).Success)
|
||||||
|
title += " RUS";
|
||||||
|
|
||||||
if (stripCyrillicLetters)
|
if (stripCyrillicLetters)
|
||||||
title = _stripCyrillicRegex.Replace(title, string.Empty).Trim(' ', '-');
|
title = _stripCyrillicRegex.Replace(title, string.Empty).Trim(' ', '-');
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
{
|
{
|
||||||
public BoolConfigurationItem UseMagnetLinks { get; private set; }
|
public BoolConfigurationItem UseMagnetLinks { get; private set; }
|
||||||
public BoolConfigurationItem StripRussianLetters { get; private set; }
|
public BoolConfigurationItem StripRussianLetters { get; private set; }
|
||||||
|
public BoolConfigurationItem AddRussianToTitle { get; private set; }
|
||||||
public DisplayInfoConfigurationItem MoveTagsInfo { get; private set; }
|
public DisplayInfoConfigurationItem MoveTagsInfo { get; private set; }
|
||||||
public BoolConfigurationItem MoveFirstTagsToEndOfReleaseTitle { get; private set; }
|
public BoolConfigurationItem MoveFirstTagsToEndOfReleaseTitle { get; private set; }
|
||||||
public BoolConfigurationItem MoveAllTagsToEndOfReleaseTitle { get; private set; }
|
public BoolConfigurationItem MoveAllTagsToEndOfReleaseTitle { get; private set; }
|
||||||
@@ -16,6 +17,7 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
{
|
{
|
||||||
UseMagnetLinks = new BoolConfigurationItem("Use Magnet Links") { Value = false };
|
UseMagnetLinks = new BoolConfigurationItem("Use Magnet Links") { Value = false };
|
||||||
StripRussianLetters = new BoolConfigurationItem("Strip Russian Letters") { Value = true };
|
StripRussianLetters = new BoolConfigurationItem("Strip Russian Letters") { Value = true };
|
||||||
|
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 };
|
||||||
MoveTagsInfo = new DisplayInfoConfigurationItem("Move Tags Info", "<b>About moving tags:</b> " +
|
MoveTagsInfo = new DisplayInfoConfigurationItem("Move Tags Info", "<b>About moving tags:</b> " +
|
||||||
"We define a tag as a part of the release title between round or square brackets. " +
|
"We define a tag as a part of the release title between round or square brackets. " +
|
||||||
"If the release title contains tags then these options will move those tags and their brackets to the end of the release title. " +
|
"If the release title contains tags then these options will move those tags and their brackets to the end of the release title. " +
|
||||||
|
Reference in New Issue
Block a user