mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
animebytes: new option for more fine-grain synonymn selections (#9484)
This commit is contained in:
@@ -24,7 +24,9 @@ namespace Jackett.Common.Indexers
|
|||||||
private string ScrapeUrl => SiteLink + "scrape.php";
|
private string ScrapeUrl => SiteLink + "scrape.php";
|
||||||
public bool AllowRaws => configData.IncludeRaw.Value;
|
public bool AllowRaws => configData.IncludeRaw.Value;
|
||||||
public bool PadEpisode => configData.PadEpisode != null && configData.PadEpisode.Value;
|
public bool PadEpisode => configData.PadEpisode != null && configData.PadEpisode.Value;
|
||||||
public bool AddSynonyms => configData.AddSynonyms.Value;
|
public bool AddJapaneseTitle => configData.AddJapaneseTitle.Value;
|
||||||
|
public bool AddRomajiTitle => configData.AddRomajiTitle.Value;
|
||||||
|
public bool AddAlternativeTitles => configData.AddAlternativeTitles.Value;
|
||||||
public bool FilterSeasonEpisode => configData.FilterSeasonEpisode.Value;
|
public bool FilterSeasonEpisode => configData.FilterSeasonEpisode.Value;
|
||||||
|
|
||||||
private new ConfigurationDataAnimeBytes configData
|
private new ConfigurationDataAnimeBytes configData
|
||||||
@@ -208,10 +210,31 @@ namespace Jackett.Common.Indexers
|
|||||||
mainTitle = SeriesName;
|
mainTitle = SeriesName;
|
||||||
|
|
||||||
synonyms.Add(mainTitle);
|
synonyms.Add(mainTitle);
|
||||||
if (AddSynonyms)
|
|
||||||
|
if (group["Synonymns"].HasValues)
|
||||||
{
|
{
|
||||||
foreach (string synonym in group["Synonymns"])
|
if (group["Synonymns"] is JArray)
|
||||||
synonyms.Add(synonym);
|
{
|
||||||
|
List<string> allSyonyms = group["Synonymns"].ToObject<List<string>>();
|
||||||
|
|
||||||
|
if (AddJapaneseTitle && allSyonyms.Count >= 1)
|
||||||
|
synonyms.Add(allSyonyms[0]);
|
||||||
|
if (AddRomajiTitle && allSyonyms.Count >= 2)
|
||||||
|
synonyms.Add(allSyonyms[1]);
|
||||||
|
if (AddAlternativeTitles && allSyonyms.Count >= 3)
|
||||||
|
synonyms.AddRange(allSyonyms[2].Split(',').Select(t => t.Trim()));
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
Dictionary<int, string> allSynonyms = group["Synonymns"].ToObject<Dictionary<int, string>>();
|
||||||
|
|
||||||
|
if (AddJapaneseTitle && allSynonyms.ContainsKey(0))
|
||||||
|
synonyms.Add(allSynonyms[0]);
|
||||||
|
if (AddRomajiTitle && allSynonyms.ContainsKey(1))
|
||||||
|
synonyms.Add(allSynonyms[1]);
|
||||||
|
if (AddAlternativeTitles && allSynonyms.ContainsKey(2)) {
|
||||||
|
synonyms.AddRange(allSynonyms[2].Split(',').Select(t => t.Trim()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<int> Category = null;
|
List<int> Category = null;
|
||||||
|
@@ -5,7 +5,9 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
public BoolItem IncludeRaw { get; private set; }
|
public BoolItem IncludeRaw { get; private set; }
|
||||||
//public DisplayItem DateWarning { get; private set; }
|
//public DisplayItem DateWarning { get; private set; }
|
||||||
public BoolItem PadEpisode { get; private set; }
|
public BoolItem PadEpisode { get; private set; }
|
||||||
public BoolItem AddSynonyms { get; private set; }
|
public BoolItem AddJapaneseTitle { get; private set; }
|
||||||
|
public BoolItem AddRomajiTitle { get; private set; }
|
||||||
|
public BoolItem AddAlternativeTitles { get; private set; }
|
||||||
public BoolItem FilterSeasonEpisode { get; private set; }
|
public BoolItem FilterSeasonEpisode { get; private set; }
|
||||||
|
|
||||||
public ConfigurationDataAnimeBytes(string instructionMessageOptional = null)
|
public ConfigurationDataAnimeBytes(string instructionMessageOptional = null)
|
||||||
@@ -14,7 +16,9 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
IncludeRaw = new BoolItem() { Name = "IncludeRaw", Value = false };
|
IncludeRaw = new BoolItem() { Name = "IncludeRaw", Value = false };
|
||||||
//DateWarning = new DisplayItem("This tracker does not supply upload dates so they are based off year of release.") { Name = "DateWarning" };
|
//DateWarning = new DisplayItem("This tracker does not supply upload dates so they are based off year of release.") { Name = "DateWarning" };
|
||||||
PadEpisode = new BoolItem() { Name = "Pad episode number for Sonarr compatability", Value = false };
|
PadEpisode = new BoolItem() { Name = "Pad episode number for Sonarr compatability", Value = false };
|
||||||
AddSynonyms = new BoolItem() { Name = "Add releases for each synonym title", Value = true };
|
AddJapaneseTitle = new BoolItem() { Name = "Add releases for Japanese Title", Value = false };
|
||||||
|
AddRomajiTitle = new BoolItem() { Name = "Add releases for Romaji Title", Value = false };
|
||||||
|
AddAlternativeTitles = new BoolItem() { Name = "Add releases for Alternative Title(s)", Value = false };
|
||||||
FilterSeasonEpisode = new BoolItem() { Name = "Filter results by season/episode", Value = false };
|
FilterSeasonEpisode = new BoolItem() { Name = "Filter results by season/episode", Value = false };
|
||||||
Instructions = new DisplayItem(instructionMessageOptional) { Name = "" };
|
Instructions = new DisplayItem(instructionMessageOptional) { Name = "" };
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user