Use file part count, not partial files

This commit is contained in:
Matt Nadareski
2025-08-26 06:41:01 -04:00
parent 4360916750
commit 560b3a246c
3 changed files with 6 additions and 6 deletions

View File

@@ -104,14 +104,14 @@ namespace SabreTools.Serialization.Wrappers
if (!string.IsNullOrEmpty(Filename) && File.Exists(Filename!))
{
// Find all file parts
var parts = ArchiveFactory.GetFileParts(new FileInfo(Filename));
FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(file))];
// Try to read the file path if no entries are found
if (zipFile.Entries.Count == 0)
zipFile = ZipArchive.Open(parts, readerOptions);
// If there's any multipart items, try reading the file as well
else if (!zipFile.IsComplete)
else if (parts.Length > 1)
zipFile = ZipArchive.Open(parts, readerOptions);
}

View File

@@ -107,14 +107,14 @@ namespace SabreTools.Serialization.Wrappers
if (!string.IsNullOrEmpty(Filename) && File.Exists(Filename!))
{
// Find all file parts
var parts = ArchiveFactory.GetFileParts(new FileInfo(Filename));
FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(file))];
// Try to read the file path if no entries are found
if (rarFile.Entries.Count == 0)
rarFile = RarArchive.Open(parts, readerOptions);
// If there's any multipart items, try reading the file as well
else if (!rarFile.IsComplete)
else if (parts.Length > 1)
rarFile = RarArchive.Open(parts, readerOptions);
}

View File

@@ -107,14 +107,14 @@ namespace SabreTools.Serialization.Wrappers
if (!string.IsNullOrEmpty(Filename) && File.Exists(Filename!))
{
// Find all file parts
var parts = ArchiveFactory.GetFileParts(new FileInfo(Filename));
FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(file))];
// Try to read the file path if no entries are found
if (sevenZip.Entries.Count == 0)
sevenZip = SevenZipArchive.Open(parts, readerOptions);
// If there's any multipart items, try reading the file as well
else if (!sevenZip.IsComplete)
else if (parts.Length > 1)
sevenZip = SevenZipArchive.Open(parts, readerOptions);
}