Update packages, fix build

This commit is contained in:
Matt Nadareski
2024-04-24 13:45:38 -04:00
parent dc889afdbb
commit c53a506dba
56 changed files with 199 additions and 1378 deletions

View File

@@ -1,6 +1,6 @@
using System.IO;
using System.Text;
using SabreTools.IO;
using SabreTools.IO.Extensions;
using SabreTools.Matching;
namespace SabreTools.FileTypes.Aaru

View File

@@ -6,10 +6,9 @@ using System.Text.RegularExpressions;
using Compress;
using Compress.gZip;
using Compress.Support.Compression.Deflate;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.Hashing;
using SabreTools.IO;
using SabreTools.IO.Extensions;
namespace SabreTools.FileTypes.Archives
{
@@ -295,7 +294,7 @@ namespace SabreTools.FileTypes.Archives
public override bool IsTorrent()
{
// Check for the file existing first
if (!File.Exists(this.Filename))
if (this.Filename == null || !File.Exists(this.Filename))
return false;
string datum = Path.GetFileName(this.Filename).ToLowerInvariant();
@@ -356,7 +355,7 @@ namespace SabreTools.FileTypes.Archives
public BaseFile? GetTorrentGZFileInfo()
{
// Check for the file existing first
if (!File.Exists(this.Filename))
if (this.Filename == null || !File.Exists(this.Filename))
return null;
string datum = Path.GetFileName(this.Filename).ToLowerInvariant();

View File

@@ -149,7 +149,7 @@ namespace SabreTools.FileTypes.Archives
SharpCompress.Archives.Rar.RarArchive ra = SharpCompress.Archives.Rar.RarArchive.Open(this.Filename, new ReaderOptions { LeaveStreamOpen = false, });
foreach (RarArchiveEntry entry in ra.Entries)
{
if (entry != null && !entry.IsDirectory && entry.Key.Contains(entryName))
if (entry?.Key != null && !entry.IsDirectory && entry.Key.Contains(entryName))
{
// Write the file out
realEntry = entry.Key;
@@ -248,19 +248,19 @@ namespace SabreTools.FileTypes.Archives
string? lastRarEntry = null;
foreach (RarArchiveEntry entry in rarEntries)
{
if (entry != null)
if (entry?.Key == null)
continue;
// If the current is a superset of last, we skip it
if (lastRarEntry != null && lastRarEntry.StartsWith(entry.Key))
{
// If the current is a superset of last, we skip it
if (lastRarEntry != null && lastRarEntry.StartsWith(entry.Key))
{
// No-op
}
// If the entry is a directory, we add it
else if (entry.IsDirectory)
{
empties.Add(entry.Key);
lastRarEntry = entry.Key;
}
// No-op
}
// If the entry is a directory, we add it
else if (entry.IsDirectory)
{
empties.Add(entry.Key);
lastRarEntry = entry.Key;
}
}
}

View File

@@ -146,7 +146,7 @@ namespace SabreTools.FileTypes.Archives
TarArchive ta = TarArchive.Open(this.Filename!, new ReaderOptions { LeaveStreamOpen = false, });
foreach (TarArchiveEntry entry in ta.Entries)
{
if (entry != null && !entry.IsDirectory && entry.Key.Contains(entryName))
if (entry?.Key != null && !entry.IsDirectory && entry.Key.Contains(entryName))
{
// Write the file out
realEntry = entry.Key;
@@ -237,19 +237,19 @@ namespace SabreTools.FileTypes.Archives
string? lastTarEntry = null;
foreach (TarArchiveEntry entry in tarEntries)
{
if (entry != null)
if (entry?.Key == null)
continue;
// If the current is a superset of last, we skip it
if (lastTarEntry != null && lastTarEntry.StartsWith(entry.Key))
{
// If the current is a superset of last, we skip it
if (lastTarEntry != null && lastTarEntry.StartsWith(entry.Key))
{
// No-op
}
// If the entry is a directory, we add it
else if (entry.IsDirectory)
{
empties.Add(entry.Key);
lastTarEntry = entry.Key;
}
// No-op
}
// If the entry is a directory, we add it
else if (entry.IsDirectory)
{
empties.Add(entry.Key);
lastTarEntry = entry.Key;
}
}
}
@@ -315,7 +315,7 @@ namespace SabreTools.FileTypes.Archives
{
// Get temporary date-time if possible
DateTime? usableDate = null;
if (UseDates && !string.IsNullOrEmpty(baseFile.Date) && DateTime.TryParse(baseFile.Date.Replace('\\', '/'), out DateTime dt))
if (UseDates && !string.IsNullOrEmpty(baseFile.Date) && DateTime.TryParse(baseFile.Date!.Replace('\\', '/'), out DateTime dt))
usableDate = dt;
// Copy the input stream to the output

View File

@@ -2,10 +2,9 @@
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.Hashing;
using SabreTools.IO;
using SabreTools.IO.Extensions;
#if NET462_OR_GREATER || NETCOREAPP
using SharpCompress.Compressors.Xz;
#endif

View File

@@ -1,17 +1,10 @@
using System.Collections.Generic;
using System.IO;
using System.IO;
using System.Linq;
#if NET40_OR_GREATER || NETCOREAPP
using System.Threading.Tasks;
#endif
using Compress.Support.Compression.LZMA;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.FileTypes.Aaru;
using SabreTools.FileTypes.CHD;
using SabreTools.Hashing;
using SabreTools.IO;
using SabreTools.Logging;
using SabreTools.IO.Extensions;
using SabreTools.Matching;
using SabreTools.Skippers;

View File

@@ -1,7 +1,7 @@
using System;
using System.IO;
using System.Text;
using SabreTools.IO;
using SabreTools.IO.Extensions;
namespace SabreTools.FileTypes.CHD
{

View File

@@ -1,8 +1,7 @@
using System;
using System.IO;
using System.Text;
using SabreTools.IO;
using SabreTools.IO.Extensions;
namespace SabreTools.FileTypes.CHD
{

View File

@@ -1,8 +1,7 @@
using System;
using System.IO;
using System.Text;
using SabreTools.IO;
using SabreTools.IO.Extensions;
namespace SabreTools.FileTypes.CHD
{

View File

@@ -1,8 +1,7 @@
using System;
using System.IO;
using System.Text;
using SabreTools.IO;
using SabreTools.IO.Extensions;
namespace SabreTools.FileTypes.CHD
{

View File

@@ -1,8 +1,7 @@
using System;
using System.IO;
using System.Text;
using SabreTools.IO;
using SabreTools.IO.Extensions;
namespace SabreTools.FileTypes.CHD
{

View File

@@ -1,7 +1,6 @@
using System.IO;
using System.Text;
using SabreTools.IO;
using SabreTools.IO.Extensions;
namespace SabreTools.FileTypes.CHD
{

View File

@@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using SabreTools.Core.Tools;
using SabreTools.FileTypes.Archives;
using SabreTools.IO;
using SabreTools.IO.Extensions;
using SabreTools.Logging;
namespace SabreTools.FileTypes

View File

@@ -27,14 +27,14 @@
<!-- Support for old .NET versions -->
<ItemGroup Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net452`))">
<PackageReference Include="SharpCompress" Version="0.36.0" />
<PackageReference Include="SharpCompress" Version="0.37.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageReference Include="ZstdSharp.Port" Version="0.7.6" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SabreTools.Hashing" Version="1.2.0" />
<PackageReference Include="SabreTools.IO" Version="1.3.2" />
<PackageReference Include="SabreTools.IO" Version="1.4.0" />
<PackageReference Include="SabreTools.Matching" Version="1.3.1" />
<PackageReference Include="SabreTools.Skippers" Version="1.1.2" />
</ItemGroup>