Metadata Optimizations (#910)
* Added a tooltip to inform user that format and collection filter selections do not only show for the selected library. * Refactored a lot of code around when we update chapter cover images. Applied an optimization for when we re-calculate volume/series covers, such that it only occurs when the first chapter's image updates. * Updated code to ensure only lastmodified gets refreshed in metadata since it always follows a scan * Optimized how metadata is populated on the series. Instead of re-reading the comicInfos, instead I read the data from the underlying chapter entities. This reduces N additional reads AND enables the ability in the future to show/edit chapter level metadata. * Spelling mistake * Fixed a concurency issue by not selecting Genres from DB. Added a test for long paths. * Fixed a bug in filter where collection tag wasn't populating on load * Cleaned up the logic for changelog to better compare against the installed verison. For nightly users, show the last stable as installed. * Removed some demo code * SplitQuery to allow loading tags much faster for series metadata load.
This commit is contained in:
parent
c215d5b7a8
commit
0be0e294aa
21 changed files with 1671 additions and 90 deletions
|
@ -52,6 +52,39 @@ namespace API.Tests.Services
|
|||
Assert.Equal(28, files.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TraverseTreeParallelForEach_LongDirectory_ShouldBe1()
|
||||
{
|
||||
var fileSystem = new MockFileSystem();
|
||||
// Create a super long path
|
||||
var testDirectory = "/manga/";
|
||||
for (var i = 0; i < 200; i++)
|
||||
{
|
||||
testDirectory = fileSystem.FileSystem.Path.Join(testDirectory, "supercalifragilisticexpialidocious");
|
||||
}
|
||||
|
||||
|
||||
fileSystem.AddFile(fileSystem.FileSystem.Path.Join(testDirectory, "file_29.jpg"), new MockFileData(""));
|
||||
|
||||
var ds = new DirectoryService(Substitute.For<ILogger<DirectoryService>>(), fileSystem);
|
||||
var files = new List<string>();
|
||||
try
|
||||
{
|
||||
var fileCount = ds.TraverseTreeParallelForEach("/manga/", s => files.Add(s),
|
||||
API.Parser.Parser.ImageFileExtensions, _logger);
|
||||
Assert.Equal(1, fileCount);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Assert.False(true);
|
||||
}
|
||||
|
||||
|
||||
Assert.Equal(1, files.Count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Fact]
|
||||
public void TraverseTreeParallelForEach_DontCountExcludedDirectories_ShouldBe28()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue