mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-08 18:06:41 +00:00
Reader options apparently moved fully
This commit is contained in:
@@ -27,9 +27,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
try
|
||||
{
|
||||
var readerOptions = new ReaderOptions() { LookForHeader = lookForHeader };
|
||||
var zipFile = ZipArchive.OpenArchive(_dataSource, readerOptions) as ZipArchive;
|
||||
if (zipFile is null)
|
||||
return false;
|
||||
var zipFile = (ZipArchive)ZipArchive.OpenArchive(_dataSource, readerOptions);
|
||||
|
||||
// If the file exists
|
||||
if (!string.IsNullOrEmpty(Filename) && File.Exists(Filename!))
|
||||
@@ -39,11 +37,11 @@ namespace SabreTools.Serialization.Wrappers
|
||||
|
||||
// If there are multiple parts
|
||||
if (parts.Length > 1)
|
||||
zipFile = ZipArchive.OpenArchive(parts, readerOptions) as ZipArchive;
|
||||
zipFile = (ZipArchive)ZipArchive.OpenArchive(parts, readerOptions);
|
||||
|
||||
// Try to read the file path if no entries are found
|
||||
else if (zipFile.Entries.Count == 0)
|
||||
zipFile = ZipArchive.OpenArchive(parts, readerOptions) as ZipArchive;
|
||||
zipFile = (ZipArchive)ZipArchive.OpenArchive(parts, readerOptions);
|
||||
|
||||
// If the archive is somehow null
|
||||
if (zipFile is null)
|
||||
|
||||
@@ -31,10 +31,13 @@ namespace SabreTools.Serialization.Wrappers
|
||||
#if NET462_OR_GREATER || NETCOREAPP || NETSTANDARD2_0_OR_GREATER
|
||||
try
|
||||
{
|
||||
var readerOptions = new ReaderOptions() { LookForHeader = lookForHeader };
|
||||
var rarFile = RarArchive.OpenArchive(_dataSource, readerOptions) as RarArchive;
|
||||
if (rarFile is null)
|
||||
return false;
|
||||
var readerOptions = new ReaderOptions()
|
||||
{
|
||||
LookForHeader = lookForHeader,
|
||||
ExtractFullPath = true,
|
||||
Overwrite = true
|
||||
};
|
||||
var rarFile = (RarArchive)RarArchive.OpenArchive(_dataSource, readerOptions);
|
||||
|
||||
// If the file exists
|
||||
if (!string.IsNullOrEmpty(Filename) && File.Exists(Filename!))
|
||||
@@ -44,15 +47,11 @@ namespace SabreTools.Serialization.Wrappers
|
||||
|
||||
// If there are multiple parts
|
||||
if (parts.Length > 1)
|
||||
rarFile = RarArchive.OpenArchive(parts, readerOptions) as RarArchive;
|
||||
rarFile = (RarArchive)RarArchive.OpenArchive(parts, readerOptions);
|
||||
|
||||
// Try to read the file path if no entries are found
|
||||
else if (rarFile.Entries.Count == 0)
|
||||
rarFile = RarArchive.OpenArchive(parts, readerOptions) as RarArchive;
|
||||
|
||||
// If the archive is somehow null
|
||||
if (rarFile is null)
|
||||
return false;
|
||||
rarFile = (RarArchive)RarArchive.OpenArchive(parts, readerOptions);
|
||||
}
|
||||
|
||||
// Explained in https://github.com/adamhathcock/sharpcompress/pull/661. in order to determine whether
|
||||
|
||||
@@ -31,8 +31,13 @@ namespace SabreTools.Serialization.Wrappers
|
||||
#if NET462_OR_GREATER || NETCOREAPP || NETSTANDARD2_0_OR_GREATER
|
||||
try
|
||||
{
|
||||
var readerOptions = new ReaderOptions() { LookForHeader = lookForHeader };
|
||||
var sevenZip = SevenZipArchive.OpenArchive(_dataSource, readerOptions) as SevenZipArchive;
|
||||
var readerOptions = new ReaderOptions()
|
||||
{
|
||||
LookForHeader = lookForHeader,
|
||||
ExtractFullPath = true,
|
||||
Overwrite = true
|
||||
};
|
||||
var sevenZip = (SevenZipArchive)SevenZipArchive.OpenArchive(_dataSource, readerOptions);
|
||||
if (sevenZip is null)
|
||||
return false;
|
||||
|
||||
@@ -44,15 +49,11 @@ namespace SabreTools.Serialization.Wrappers
|
||||
|
||||
// If there are multiple parts
|
||||
if (parts.Length > 1)
|
||||
sevenZip = SevenZipArchive.OpenArchive(parts, readerOptions) as SevenZipArchive;
|
||||
sevenZip = (SevenZipArchive)SevenZipArchive.OpenArchive(parts, readerOptions);
|
||||
|
||||
// Try to read the file path if no entries are found
|
||||
else if (sevenZip.Entries.Count == 0)
|
||||
sevenZip = SevenZipArchive.OpenArchive(parts, readerOptions) as SevenZipArchive;
|
||||
|
||||
// If the archive is somehow null
|
||||
if (sevenZip is null)
|
||||
return false;
|
||||
sevenZip = (SevenZipArchive)SevenZipArchive.OpenArchive(parts, readerOptions);
|
||||
}
|
||||
|
||||
// Explained in https://github.com/adamhathcock/sharpcompress/pull/661. in order to determine whether
|
||||
|
||||
Reference in New Issue
Block a user