Bugfix/scanner issue (#576)
* Refactored the scanner to hopefully fix a hard to reproduce KeyNotFoundException from GetInfosByName. * Added parsing support for "A Compendium of Ghosts - 031 - The Third Story_ Part 12 (Digital) (Cobalt001)"
This commit is contained in:
parent
dd6dec46c1
commit
a9ea03469f
5 changed files with 40 additions and 13 deletions
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using API.Data;
|
||||
using API.Entities.Enums;
|
||||
using API.Interfaces.Services;
|
||||
using API.Parser;
|
||||
using API.Services;
|
||||
using API.Services.Tasks.Scanner;
|
||||
using BenchmarkDotNet.Attributes;
|
||||
|
@ -14,7 +16,7 @@ namespace API.Benchmark
|
|||
[MemoryDiagnoser]
|
||||
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
|
||||
[RankColumn]
|
||||
[SimpleJob(launchCount: 1, warmupCount: 3, targetCount: 5, invocationCount: 100, id: "Test"), ShortRunJob]
|
||||
//[SimpleJob(launchCount: 1, warmupCount: 3, targetCount: 5, invocationCount: 100, id: "Test"), ShortRunJob]
|
||||
public class ParseScannedFilesBenchmarks
|
||||
{
|
||||
private readonly ParseScannedFiles _parseScannedFiles;
|
||||
|
@ -27,13 +29,37 @@ namespace API.Benchmark
|
|||
_parseScannedFiles = new ParseScannedFiles(bookService, _logger);
|
||||
}
|
||||
|
||||
// [Benchmark]
|
||||
// public void Test()
|
||||
// {
|
||||
// var libraryPath = Path.Join(Directory.GetCurrentDirectory(),
|
||||
// "../../../Services/Test Data/ScannerService/Manga");
|
||||
// var parsedSeries = _parseScannedFiles.ScanLibrariesForSeries(LibraryType.Manga, new string[] {libraryPath},
|
||||
// out var totalFiles, out var scanElapsedTime);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Generate a list of Series and another list with
|
||||
/// </summary>
|
||||
[Benchmark]
|
||||
public void Test()
|
||||
public void MergeName()
|
||||
{
|
||||
var libraryPath = Path.Join(Directory.GetCurrentDirectory(),
|
||||
"../../../Services/Test Data/ScannerService/Manga");
|
||||
var p1 = new ParserInfo()
|
||||
{
|
||||
Chapters = "0",
|
||||
Edition = "",
|
||||
Format = MangaFormat.Archive,
|
||||
FullFilePath = Path.Join(libraryPath, "A Town Where You Live", "A_Town_Where_You_Live_v01.zip"),
|
||||
IsSpecial = false,
|
||||
Series = "A Town Where You Live",
|
||||
Title = "A Town Where You Live",
|
||||
Volumes = "1"
|
||||
};
|
||||
var parsedSeries = _parseScannedFiles.ScanLibrariesForSeries(LibraryType.Manga, new string[] {libraryPath},
|
||||
out var totalFiles, out var scanElapsedTime);
|
||||
_parseScannedFiles.MergeName(p1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue