Also search for "GERMAN" if title ends with "Germany" and also match for title without "Germany"

This commit is contained in:
pcjones
2024-09-04 18:06:51 +02:00
parent 759e276311
commit fd6a8581d8

View File

@@ -108,6 +108,20 @@ namespace UmlautAdaptarr.Models
} }
// if a german title ends with "Germany" (e.g. Good Luck Guys Germany) also add a search string that replaces Germany with GERMAN
// (e.g. Good Luck Guys GERMAN). This is because reality shows often have different formats in different countries with the same
// name. // also add a matching title without GERMAN
if (germanTitle?.EndsWith("germany", StringComparison.OrdinalIgnoreCase) ?? false)
{
TitleSearchVariations = [.. TitleSearchVariations,
..
GenerateVariations(
(germanTitle[..^7] + "GERMAN").RemoveExtraWhitespaces(),
mediaType)];
allTitleVariations.AddRange(GenerateVariations(germanTitle[..^8].Trim(), mediaType));
}
// If title contains ":" also match for "-" // If title contains ":" also match for "-"
if (germanTitle?.Contains(':') ?? false) if (germanTitle?.Contains(':') ?? false)
{ {