Fixed unit test, fixed code.

This commit is contained in:
Joseph Milazzo 2025-06-23 18:38:45 -05:00
parent 2cc6873e7a
commit 62b94ce311
5 changed files with 18 additions and 4 deletions

View file

@ -941,9 +941,9 @@ public class ScannerServiceTests : AbstractDbTest
[Fact] [Fact]
public async Task ScanLibrary_MetadataEnabled_NoOverrides() public async Task ScanLibrary_MetadataDisabled_NoOverrides()
{ {
const string testcase = "Series with Localized 2 - Manga.json"; const string testcase = "Series with Localized No Metadata - Manga.json";
// Get the first file and generate a ComicInfo // Get the first file and generate a ComicInfo
var infos = new Dictionary<string, ComicInfo>(); var infos = new Dictionary<string, ComicInfo>();
@ -962,6 +962,7 @@ public class ScannerServiceTests : AbstractDbTest
var scanner = _scannerHelper.CreateServices(); var scanner = _scannerHelper.CreateServices();
await scanner.ScanLibrary(library.Id); await scanner.ScanLibrary(library.Id);
var postLib = await UnitOfWork.LibraryRepository.GetLibraryForIdAsync(library.Id, LibraryIncludes.Series); var postLib = await UnitOfWork.LibraryRepository.GetLibraryForIdAsync(library.Id, LibraryIncludes.Series);
// Validate that there are 2 series // Validate that there are 2 series

View file

@ -0,0 +1,5 @@
[
"Immoral Guild/Immoral Guild v01.cbz",
"Immoral Guild/Immoral Guild v02.cbz",
"Immoral Guild/Futoku No Guild - Vol. 12 Ch. 67 - Take Responsibility.cbz"
]

View file

@ -101,7 +101,12 @@ public class BasicParser(IDirectoryService directoryService, IDefaultParser imag
} }
// Patch in other information from ComicInfo // Patch in other information from ComicInfo
if (enableMetadata)
{
UpdateFromComicInfo(ret); UpdateFromComicInfo(ret);
}
if (ret.Volumes == Parser.LooseLeafVolume && ret.Chapters == Parser.DefaultChapter) if (ret.Volumes == Parser.LooseLeafVolume && ret.Chapters == Parser.DefaultChapter)
{ {

View file

@ -81,7 +81,10 @@ public class ComicVineParser(IDirectoryService directoryService) : DefaultParser
info.IsSpecial = Parser.IsSpecial(info.Filename, type) || Parser.IsSpecial(info.ComicInfo?.Format, type); info.IsSpecial = Parser.IsSpecial(info.Filename, type) || Parser.IsSpecial(info.ComicInfo?.Format, type);
// Patch in other information from ComicInfo // Patch in other information from ComicInfo
if (enableMetadata)
{
UpdateFromComicInfo(info); UpdateFromComicInfo(info);
}
if (string.IsNullOrEmpty(info.Series)) if (string.IsNullOrEmpty(info.Series))
{ {