Lots of Bugfixes (#2356)

This commit is contained in:
Joe Milazzo 2023-10-27 16:18:56 -05:00 committed by GitHub
parent 86e931dd9a
commit 226d6831df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 359 additions and 225 deletions

View file

@ -972,9 +972,9 @@ public class DirectoryService : IDirectoryService
foreach (var file in directory.EnumerateFiles().OrderByNatural(file => file.FullName))
{
if (file.Directory == null) continue;
var paddedIndex = Tasks.Scanner.Parser.Parser.PadZeros(directoryIndex + "");
var paddedIndex = Tasks.Scanner.Parser.Parser.PadZeros(directoryIndex + string.Empty);
// We need to rename the files so that after flattening, they are in the order we found them
var newName = $"{paddedIndex}_{Tasks.Scanner.Parser.Parser.PadZeros(fileIndex + "")}{file.Extension}";
var newName = $"{paddedIndex}_{Tasks.Scanner.Parser.Parser.PadZeros(fileIndex + string.Empty)}{file.Extension}";
var newPath = Path.Join(root.FullName, newName);
if (!File.Exists(newPath)) file.MoveTo(newPath);
fileIndex++;