Only print warning for non-contiguous files

This commit is contained in:
Deterous
2024-02-11 12:39:13 +09:00
parent cf19596ea7
commit b862057123
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -785,7 +785,7 @@ namespace IRDKit
try
{
// Read key from .key file
byte[] discKey = File.ReadAllBytes(keyPath);
byte[] discKey = File.ReadAllBytes(keyfilePath);
if (discKey == null || discKey.Length != 16)
Console.Error.WriteLine($"{hexKey} is not a valid key, detecting key automatically...");
else
+4 -4
View File
@@ -715,7 +715,7 @@ namespace LibIRD
HashFiles(fs, reader, rootDir);
if (FileCount != fileCount)
{
Console.WriteLine($"{isoPath} contains split files: detected {FileCount} out of {fileCount} expected files");
//Console.WriteLine($"{isoPath} contains split files: detected {FileCount} out of {fileCount} expected files");
long[] tempFileKeys = FileKeys;
Array.Resize(ref tempFileKeys, (int)FileCount);
FileKeys = tempFileKeys;
@@ -943,6 +943,9 @@ namespace LibIRD
if (fileClusters[i] == null)
throw new InvalidFileSystemException($"Unexpected file extents for {filePath}");
if (fileClusters[i].Offset * SectorSize != fileClusters[i - 1].Offset * SectorSize + fileClusters[i - 1].Count)
Console.WriteLine($"Non-contiguous file found: {filePath}");
if (fileClusters[i].Offset < smallestOffset)
smallestOffset = fileClusters[i].Offset;
}
@@ -951,9 +954,6 @@ namespace LibIRD
if (Array.Exists(FileKeys, element => element == smallestOffset))
continue;
if (fileClusters.Length > 1)
Console.WriteLine($"Split file detected: {filePath}");
// Add file offset to keys
FileKeys[FileCount] = smallestOffset;