mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Create FileTypeTool and move static methods
This commit is contained in:
@@ -67,16 +67,16 @@ namespace SabreTools.FileTypes.Archives
|
||||
catch (EndOfStreamException ex)
|
||||
{
|
||||
// Catch this but don't count it as an error because SharpCompress is unsafe
|
||||
logger.Verbose(ex);
|
||||
_logger.Verbose(ex);
|
||||
}
|
||||
catch (InvalidOperationException ex)
|
||||
{
|
||||
logger.Warning(ex);
|
||||
_logger.Warning(ex);
|
||||
encounteredErrors = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex);
|
||||
_logger.Error(ex);
|
||||
encounteredErrors = true;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex);
|
||||
_logger.Error(ex);
|
||||
return (null, null);
|
||||
}
|
||||
#else
|
||||
@@ -201,7 +201,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
BaseFile rarEntryRom = new();
|
||||
|
||||
// Perform a quickscan, if flagged to
|
||||
if (AvailableHashTypes.Length == 1 && AvailableHashTypes[0] == HashType.CRC32)
|
||||
if (_hashTypes.Length == 1 && _hashTypes[0] == HashType.CRC32)
|
||||
{
|
||||
rarEntryRom.Size = entry.Size;
|
||||
rarEntryRom.CRC = BitConverter.GetBytes(entry.Crc);
|
||||
@@ -210,7 +210,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
else
|
||||
{
|
||||
using Stream entryStream = entry.OpenEntryStream();
|
||||
rarEntryRom = GetInfo(entryStream, size: entry.Size, hashes: AvailableHashTypes);
|
||||
rarEntryRom = GetInfo(entryStream, size: entry.Size, hashes: _hashTypes);
|
||||
}
|
||||
|
||||
// Fill in common details and add to the list
|
||||
@@ -225,7 +225,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex);
|
||||
_logger.Error(ex);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex);
|
||||
_logger.Error(ex);
|
||||
}
|
||||
|
||||
return empties;
|
||||
|
||||
Reference in New Issue
Block a user