From 560b3a246ccbd15c6d133d0722e6c9607e211b23 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 26 Aug 2025 06:41:01 -0400 Subject: [PATCH] Use file part count, not partial files --- SabreTools.Serialization/Wrappers/PKZIP.cs | 4 ++-- SabreTools.Serialization/Wrappers/RAR.cs | 4 ++-- SabreTools.Serialization/Wrappers/SevenZip.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SabreTools.Serialization/Wrappers/PKZIP.cs b/SabreTools.Serialization/Wrappers/PKZIP.cs index 7a9edbc6..e293ae5a 100644 --- a/SabreTools.Serialization/Wrappers/PKZIP.cs +++ b/SabreTools.Serialization/Wrappers/PKZIP.cs @@ -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); } diff --git a/SabreTools.Serialization/Wrappers/RAR.cs b/SabreTools.Serialization/Wrappers/RAR.cs index 8a93aa17..80a5010f 100644 --- a/SabreTools.Serialization/Wrappers/RAR.cs +++ b/SabreTools.Serialization/Wrappers/RAR.cs @@ -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); } diff --git a/SabreTools.Serialization/Wrappers/SevenZip.cs b/SabreTools.Serialization/Wrappers/SevenZip.cs index 32e5373e..e78e2ca1 100644 --- a/SabreTools.Serialization/Wrappers/SevenZip.cs +++ b/SabreTools.Serialization/Wrappers/SevenZip.cs @@ -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); }