Scanner not merging with series that has LocalizedName match (#950)

* When performing a scan, series should group if they share the same localized name as a pre-existing series.

* Fixed a bug where a series with a different name and localized name weren't merging with a different set of files with the same naming as localized name.
This commit is contained in:
Joseph Milazzo 2022-01-16 15:48:15 -08:00 committed by GitHub
parent 2434e96fe9
commit ce3bd92244
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 52 additions and 6 deletions

View file

@ -102,6 +102,41 @@ public class SeriesHelperTests
NormalizedName = API.Parser.Parser.Normalize("SomethingRandom")
}));
}
[Fact]
public void FindSeries_ShouldFind_UsingLocalizedName()
{
var series = DbFactory.Series("Darker than Black");
series.LocalizedName = "Something Random";
series.Format = MangaFormat.Image;
Assert.True(SeriesHelper.FindSeries(series, new ParsedSeries()
{
Format = MangaFormat.Image,
Name = "Something Random",
NormalizedName = API.Parser.Parser.Normalize("Something Random")
}));
Assert.True(SeriesHelper.FindSeries(series, new ParsedSeries()
{
Format = MangaFormat.Image,
Name = "Something Random".ToLower(),
NormalizedName = API.Parser.Parser.Normalize("Something Random")
}));
Assert.True(SeriesHelper.FindSeries(series, new ParsedSeries()
{
Format = MangaFormat.Image,
Name = "Something Random".ToUpper(),
NormalizedName = API.Parser.Parser.Normalize("Something Random")
}));
Assert.True(SeriesHelper.FindSeries(series, new ParsedSeries()
{
Format = MangaFormat.Image,
Name = "SomethingRandom".ToUpper(),
NormalizedName = API.Parser.Parser.Normalize("SomethingRandom")
}));
}
#endregion
[Fact]