diff --git a/SabreTools.Serialization/Wrappers/PKZIP.cs b/SabreTools.Serialization/Wrappers/PKZIP.cs index b3f4b80d..b87c16a3 100644 --- a/SabreTools.Serialization/Wrappers/PKZIP.cs +++ b/SabreTools.Serialization/Wrappers/PKZIP.cs @@ -105,13 +105,13 @@ namespace SabreTools.Serialization.Wrappers { // Find all file parts FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(Filename))]; + + // If there are multiple parts + if (parts.Length > 1) + zipFile = ZipArchive.Open(parts, readerOptions); // 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 (parts.Length > 1) + else if (zipFile.Entries.Count == 0) zipFile = ZipArchive.Open(parts, readerOptions); } diff --git a/SabreTools.Serialization/Wrappers/RAR.cs b/SabreTools.Serialization/Wrappers/RAR.cs index 25defacb..8ac67593 100644 --- a/SabreTools.Serialization/Wrappers/RAR.cs +++ b/SabreTools.Serialization/Wrappers/RAR.cs @@ -108,13 +108,13 @@ namespace SabreTools.Serialization.Wrappers { // Find all file parts FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(Filename))]; + + // If there are multiple parts + if (parts.Length > 1) + rarFile = RarArchive.Open(parts, readerOptions); // 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 (parts.Length > 1) + else if (rarFile.Entries.Count == 0) rarFile = RarArchive.Open(parts, readerOptions); } diff --git a/SabreTools.Serialization/Wrappers/SevenZip.cs b/SabreTools.Serialization/Wrappers/SevenZip.cs index ee55b4eb..6d7788a0 100644 --- a/SabreTools.Serialization/Wrappers/SevenZip.cs +++ b/SabreTools.Serialization/Wrappers/SevenZip.cs @@ -108,13 +108,13 @@ namespace SabreTools.Serialization.Wrappers { // Find all file parts FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(Filename))]; + + // If there are multiple parts + if (parts.Length > 1) + sevenZip = SevenZipArchive.Open(parts, readerOptions); // 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 (parts.Length > 1) + else if (sevenZip.Entries.Count == 0) sevenZip = SevenZipArchive.Open(parts, readerOptions); }