mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 23:05:12 +00:00
Use file part count, not partial files
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user