Fixed: DiskScanService.cs Scan() function now utilizes the 'authorIds' variable in the function call

When a list of authorIds is passed into the DiskScanService 'Scan' function, the current code disregards the authorIds array that's passed in and scans the entire folder structure unnecessarily. When new authors are added, it should only scan their folders, not the entire root again as it takes a significant amount of time for large libraries and prevents us from being able to do Part 2 of this change coming next...
Part 2, if we correct this step will then enable us to create the missing Authors folder, resulting in a 'fixed' user interface option 'Create empty Author folders' (this currently does nothing).

All these changes were in the DiskScanService.cs file alone.
Updated the "public void Scan()" function so it respects the 'Author' variable being passed in and populates the folder array correctly.

This is required to enable commit ## to fix the 'Create Empty Author Folders' functionality.
This commit is contained in:
dny238 2023-01-20 18:29:30 -07:00
parent 2bde9d13dd
commit 8eebce5171

View file

@ -89,6 +89,19 @@ public void Scan(List<string> folders = null, FilterFilesType filter = FilterFil
{
authorIds = new List<int>();
}
else
{
folders = new List<string>();
foreach (var authorId in authorIds)
{
var author = _authorService.GetAuthor(authorId);
if (author != null)
{
folders.Add(author.Path);
}
}
}
var mediaFileList = new List<IFileInfo>();