19 Commits

Author SHA1 Message Date
7cc5445041 Migrate solution to XML format. 2025-09-25 15:03:16 +01:00
2c9803211f Set severity of ph2151 diagnostic to none in .editorconfig 2025-09-25 15:02:58 +01:00
e95bc8968f Remove Avalonia.ReactiveUI package reference from Directory.Packages.props 2025-09-13 13:04:03 +01:00
9a1cdd0557 Update plist-cil package version to 2.3.1 2025-09-13 13:02:49 +01:00
35ca3f4e46 Update Philips.CodeAnalysis.MaintainabilityAnalyzers package version to 1.9.1 2025-09-13 13:02:31 +01:00
28ee6d2c16 Update Avalonia package versions and remove SkiaSharp.NativeAssets.Linux reference 2025-09-13 12:59:50 +01:00
f470fdea81 Update ErrorProne.NET package versions in Directory.Packages.props 2025-09-13 12:55:32 +01:00
1e0567924b Upgrade target framework to .NET 10 and update package versions to match 2025-09-13 12:55:14 +01:00
01eaf3cf80 Update package versions and remove duplicates in Directory.Packages.props 2025-09-13 12:47:29 +01:00
ff2785c72a Add Philips.CodeAnalysis.MaintainabilityAnalyzers package reference 2025-09-13 12:47:18 +01:00
1b4ea7609a Enable unsafe code blocks in project settings 2025-09-13 12:47:04 +01:00
31f7b2c2ff Change syntax for .NET 10 compatibility. 2025-09-13 12:45:25 +01:00
60e21a150f Add build properties files so it doesn't get package instructions from parent folders. 2025-09-13 12:44:54 +01:00
f6500da3ff [App] Be more verbose about what is happening when a file is not imported because not known, or duplicate. 2025-07-31 04:22:53 +01:00
3cd5cf4b73 Localize missing string. 2025-07-31 04:21:06 +01:00
078348c054 Catch any other exception when importing ROMs and in GUI inform the user. 2025-07-31 04:13:43 +01:00
d26000c7c8 Ignore exceptions when removing temporary files.
Need to investigate why anyway.
2025-07-31 04:13:00 +01:00
2942c6dfc8 Do not import files that are already in the repository. 2025-07-31 04:09:13 +01:00
5265ad4ef8 Remove unneeded global.json. 2025-07-31 04:08:37 +01:00
18 changed files with 198 additions and 154 deletions

View File

@@ -1478,6 +1478,7 @@ dotnet_diagnostic.ph2097.severity = warning
dotnet_diagnostic.ph2098.severity = warning
dotnet_diagnostic.ph2101.severity = warning
dotnet_diagnostic.ph2102.severity = none
dotnet_diagnostic.ph2151.severity = none
dotnet_diagnostic.mt1001.severity = warning
dotnet_diagnostic.mt1002.severity = warning

View File

@@ -1,11 +1,9 @@
<Project>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<NeutralLanguage>en</NeutralLanguage>
<LangVersion>default</LangVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`))">
@@ -32,6 +30,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Philips.CodeAnalysis.MaintainabilityAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

View File

@@ -1,35 +1,41 @@
<Project ToolsVersion="15.0">
<ItemGroup>
<PackageVersion Include="Aaru.Checksums.Native" Version="6.0.0-alpha.10"/>
<PackageVersion Include="Aaru.Checksums.Native" Version="6.0.0-alpha.11"/>
<PackageVersion Include="AsyncFixer" Version="1.6.0"/>
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.2"/>
<PackageVersion Include="Avalonia.Desktop" Version="11.3.2"/>
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.2"/>
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.6"/>
<PackageVersion Include="Avalonia.Desktop" Version="11.3.6"/>
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.6"/>
<PackageVersion Include="Avalonia.Svg.Skia" Version="11.3.0"/>
<PackageVersion Include="Avalonia.Themes.Fluent" Version="11.3.2"/>
<PackageVersion Include="Avalonia" Version="11.3.2"/>
<PackageVersion Include="Avalonia.Themes.Fluent" Version="11.3.6"/>
<PackageVersion Include="Avalonia" Version="11.3.6"/>
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
<PackageVersion Include="DotNetZip" Version="1.16.0"/>
<PackageVersion Include="EFCore.BulkExtensions" Version="9.0.1"/>
<PackageVersion Include="ErrorProne.NET.CoreAnalyzers" Version="0.1.2"/>
<PackageVersion Include="ErrorProne.NET.Structs" Version="0.1.2"/>
<PackageVersion Include="ErrorProne.NET.CoreAnalyzers" Version="0.8.2-beta.1"/>
<PackageVersion Include="ErrorProne.NET.Structs" Version="0.6.1-beta.1"/>
<PackageVersion Include="InclusivenessAnalyzer" Version="1.3.0"/>
<PackageVersion Include="MessageBox.Avalonia" Version="3.2.0"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.7"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Proxies" Version="9.0.7"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.7"/>
<PackageVersion Include="Microsoft.Extensions.Localization" Version="9.0.7"/>
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.7"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0-rc.1.25451.107"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Proxies" Version="10.0.0-rc.1.25451.107"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0-rc.1.25451.107"/>
<PackageVersion Include="Microsoft.Extensions.Localization" Version="10.0.0-rc.1.25451.107"/>
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.0-rc.1.25451.107"/>
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.12.1"/>
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.12.1"/>
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.DataGrid.EntityFrameworkAdapter" Version="4.12.1"/>
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15"/>
<PackageVersion Include="Microsoft.Win32.Registry" Version="5.0.0"/>
<PackageVersion Include="Mono.Fuse.NETStandard" Version="1.1.0"/>
<PackageVersion Include="Philips.CodeAnalysis.MaintainabilityAnalyzers" Version="1.6.3"/>
<PackageVersion Include="plist-cil" Version="2.2.0"/>
<PackageVersion Include="Philips.CodeAnalysis.MaintainabilityAnalyzers" Version="1.9.1"/>
<PackageVersion Include="plist-cil" Version="2.3.1"/>
<PackageVersion Include="Roslynator.Analyzers" Version="4.14.0"/>
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.14.0"/>
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.14.0"/>
<PackageVersion Include="SabreTools.Hashing" Version="1.2.3"/>
<PackageVersion Include="SabreTools.IO" Version="1.4.13"/>
<PackageVersion Include="SabreTools.Matching" Version="1.3.4"/>
<PackageVersion Include="SabreTools.Models" Version="1.5.8"/>
<PackageVersion Include="SabreTools.Skippers" Version="1.1.3"/>
<PackageVersion Include="Serilog" Version="4.3.0"/>
<PackageVersion Include="Serilog.AspNetCore" Version="9.0.0"/>
<PackageVersion Include="Serilog.Extensions.Logging" Version="9.0.2"/>
@@ -37,20 +43,11 @@
<PackageVersion Include="Serilog.Sinks.File" Version="7.0.0"/>
<PackageVersion Include="SharpCompress" Version="0.39.0"/>
<PackageVersion Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31"/>
<PackageVersion Include="System.IO.Compression" Version="4.3.0"/>
<PackageVersion Include="System.Security.Principal.Windows" Version="5.0.0"/>
<PackageVersion Include="System.Text.Encoding.CodePages" Version="10.0.0-rc.1.25451.107"/>
<PackageVersion Include="Text.Analyzers" Version="4.14.0"/>
<PackageVersion Include="winfsp.net" Version="2.1.25156"/>
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageVersion Include="SabreTools.Hashing" Version="1.2.3"/>
<PackageVersion Include="SabreTools.IO" Version="1.4.13"/>
<PackageVersion Include="SabreTools.Matching" Version="1.3.4"/>
<PackageVersion Include="SabreTools.Skippers" Version="1.1.3"/>
<PackageVersion Include="System.IO.Compression" Version="4.3.0"/>
<PackageVersion Include="SharpCompress" Version="0.38.0"/>
<PackageVersion Include="System.Text.Encoding.CodePages" Version="8.0.0"/>
<PackageVersion Include="ZstdSharp.Port" Version="0.8.6"/>
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.12.1"/>
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.12.1"/>
<PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="3.116.1" Condition="$(RuntimeIdentifier.StartsWith('linux'))" />
</ItemGroup>
</Project>

View File

@@ -327,6 +327,9 @@ public partial class ImportRoms : ComponentBase
if(!archiveImporter.IsCrcInDb(reader.Entry.Crc) && KnownOnlyChecked) continue;
// Do not import files that are already in the repository
if(archiveImporter.IsInRepo(reader.Entry.Crc)) continue;
var worker = new FileImporter(_ctx,
_newFiles,
_newDisks,
@@ -342,10 +345,24 @@ public partial class ImportRoms : ComponentBase
tmpFile,
reader.Entry.Size);
if(File.Exists(tmpFile)) File.Delete(tmpFile);
try
{
if(File.Exists(tmpFile)) File.Delete(tmpFile);
}
catch(IOException)
#pragma warning disable PH2098
{
// Ignore IO exceptions when deleting temporary files
}
#pragma warning restore PH2098
}
}
catch(InvalidOperationException) {}
#pragma warning disable RCS1075, PH2098, ERP022
catch(Exception)
{
// Show must go on
}
#pragma warning restore RCS1075, PH2098, ERP022
finally
{
Interlocked.Increment(ref _listPosition);

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PublishSingleFile>true</PublishSingleFile>

View File

@@ -50,52 +50,52 @@ public static class BigEndianBitConverter
/// <summary>Returns the specified Boolean value as an array of bytes.</summary>
/// <param name="value">A Boolean value.</param>
/// <returns>An array of bytes with length 1.</returns>
public static byte[] GetBytes(bool value) => BitConverter.GetBytes(value).Reverse().ToArray();
public static byte[] GetBytes(bool value) => Enumerable.ToArray(Enumerable.Reverse(BitConverter.GetBytes(value)));
/// <summary>Returns the specified Unicode character value as an array of bytes.</summary>
/// <param name="value">A character to convert.</param>
/// <returns>An array of bytes with length 2.</returns>
public static byte[] GetBytes(char value) => BitConverter.GetBytes(value).Reverse().ToArray();
public static byte[] GetBytes(char value) => Enumerable.ToArray(Enumerable.Reverse(BitConverter.GetBytes(value)));
/// <summary>Returns the specified double-precision floating point value as an array of bytes.</summary>
/// <param name="value">The number to convert.</param>
/// <returns>An array of bytes with length 8.</returns>
public static byte[] GetBytes(double value) => BitConverter.GetBytes(value).Reverse().ToArray();
public static byte[] GetBytes(double value) => Enumerable.ToArray(Enumerable.Reverse(BitConverter.GetBytes(value)));
/// <summary>Returns the specified single-precision floating point value as an array of bytes.</summary>
/// <param name="value">The number to convert.</param>
/// <returns>An array of bytes with length 4.</returns>
public static byte[] GetBytes(float value) => BitConverter.GetBytes(value).Reverse().ToArray();
public static byte[] GetBytes(float value) => Enumerable.ToArray(Enumerable.Reverse(BitConverter.GetBytes(value)));
/// <summary>Returns the specified 32-bit signed integer value as an array of bytes.</summary>
/// <param name="value">The number to convert.</param>
/// <returns>An array of bytes with length 4.</returns>
public static byte[] GetBytes(int value) => BitConverter.GetBytes(value).Reverse().ToArray();
public static byte[] GetBytes(int value) => Enumerable.ToArray(Enumerable.Reverse(BitConverter.GetBytes(value)));
/// <summary>Returns the specified 64-bit signed integer value as an array of bytes.</summary>
/// <param name="value">The number to convert.</param>
/// <returns>An array of bytes with length 8.</returns>
public static byte[] GetBytes(long value) => BitConverter.GetBytes(value).Reverse().ToArray();
public static byte[] GetBytes(long value) => Enumerable.ToArray(Enumerable.Reverse(BitConverter.GetBytes(value)));
/// <summary>Returns the specified 16-bit signed integer value as an array of bytes.</summary>
/// <param name="value">The number to convert.</param>
/// <returns>An array of bytes with length 2.</returns>
public static byte[] GetBytes(short value) => BitConverter.GetBytes(value).Reverse().ToArray();
public static byte[] GetBytes(short value) => Enumerable.ToArray(Enumerable.Reverse(BitConverter.GetBytes(value)));
/// <summary>Returns the specified 32-bit unsigned integer value as an array of bytes.</summary>
/// <param name="value">The number to convert.</param>
/// <returns>An array of bytes with length 4.</returns>
public static byte[] GetBytes(uint value) => BitConverter.GetBytes(value).Reverse().ToArray();
public static byte[] GetBytes(uint value) => Enumerable.ToArray(Enumerable.Reverse(BitConverter.GetBytes(value)));
/// <summary>Returns the specified 64-bit unsigned integer value as an array of bytes.</summary>
/// <param name="value">The number to convert.</param>
/// <returns>An array of bytes with length 8.</returns>
public static byte[] GetBytes(ulong value) => BitConverter.GetBytes(value).Reverse().ToArray();
public static byte[] GetBytes(ulong value) => Enumerable.ToArray(Enumerable.Reverse(BitConverter.GetBytes(value)));
/// <summary>Returns the specified 16-bit unsigned integer value as an array of bytes.</summary>
/// <param name="value">The number to convert.</param>
/// <returns>An array of bytes with length 2.</returns>
public static byte[] GetBytes(ushort value) => BitConverter.GetBytes(value).Reverse().ToArray();
public static byte[] GetBytes(ushort value) => Enumerable.ToArray(Enumerable.Reverse(BitConverter.GetBytes(value)));
/// <summary>Converts the specified 64-bit signed integer to a double-precision floating point number.</summary>
/// <param name="value">The number to convert.</param>
@@ -154,7 +154,7 @@ public static class BigEndianBitConverter
/// minus 1.
/// </exception>
public static short ToInt16(byte[] value, int startIndex) =>
BitConverter.ToInt16(value.Reverse().ToArray(), value.Length - sizeof(short) - startIndex);
BitConverter.ToInt16(Enumerable.ToArray(Enumerable.Reverse(value)), value.Length - sizeof(short) - startIndex);
/// <summary>Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.</summary>
/// <param name="value">An array of bytes.</param>
@@ -170,7 +170,7 @@ public static class BigEndianBitConverter
/// minus 1.
/// </exception>
public static int ToInt32(byte[] value, int startIndex) =>
BitConverter.ToInt32(value.Reverse().ToArray(), value.Length - sizeof(int) - startIndex);
BitConverter.ToInt32(Enumerable.ToArray(Enumerable.Reverse(value)), value.Length - sizeof(int) - startIndex);
/// <summary>Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array.</summary>
/// <param name="value">An array of bytes.</param>
@@ -186,7 +186,7 @@ public static class BigEndianBitConverter
/// length of value minus 1.
/// </exception>
public static long ToInt64(byte[] value, int startIndex) =>
BitConverter.ToInt64(value.Reverse().ToArray(), value.Length - sizeof(long) - startIndex);
BitConverter.ToInt64(Enumerable.ToArray(Enumerable.Reverse(value)), value.Length - sizeof(long) - startIndex);
/// <summary>
/// Returns a single-precision floating point number converted from four bytes at a specified position in a byte
@@ -205,7 +205,7 @@ public static class BigEndianBitConverter
/// length of value minus 1.
/// </exception>
public static float ToSingle(byte[] value, int startIndex) =>
BitConverter.ToSingle(value.Reverse().ToArray(), value.Length - sizeof(float) - startIndex);
BitConverter.ToSingle(Enumerable.ToArray(Enumerable.Reverse(value)), value.Length - sizeof(float) - startIndex);
/// <summary>
/// Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string
@@ -217,7 +217,7 @@ public static class BigEndianBitConverter
/// element in value; for example, "7F-2C-4A".
/// </returns>
/// <exception cref="System.ArgumentNullException">value is null.</exception>
public static string ToString(byte[] value) => BitConverter.ToString(value.Reverse().ToArray());
public static string ToString(byte[] value) => BitConverter.ToString(Enumerable.ToArray(Enumerable.Reverse(value)));
/// <summary>
/// Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal
@@ -235,7 +235,7 @@ public static class BigEndianBitConverter
/// minus 1.
/// </exception>
public static string ToString(byte[] value, int startIndex) =>
BitConverter.ToString(value.Reverse().ToArray(), startIndex);
BitConverter.ToString(Enumerable.ToArray(Enumerable.Reverse(value)), startIndex);
/// <summary>
/// Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal
@@ -258,7 +258,7 @@ public static class BigEndianBitConverter
/// value; that is, the startIndex parameter is greater than the length of value minus the length parameter.
/// </exception>
public static string ToString(byte[] value, int startIndex, int length) =>
BitConverter.ToString(value.Reverse().ToArray(), startIndex, length);
BitConverter.ToString(Enumerable.ToArray(Enumerable.Reverse(value)), startIndex, length);
/// <summary>Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.</summary>
/// <param name="value">The array of bytes.</param>
@@ -271,7 +271,7 @@ public static class BigEndianBitConverter
/// minus 1.
/// </exception>
public static ushort ToUInt16(byte[] value, int startIndex) =>
BitConverter.ToUInt16(value.Reverse().ToArray(), value.Length - sizeof(ushort) - startIndex);
BitConverter.ToUInt16(Enumerable.ToArray(Enumerable.Reverse(value)), value.Length - sizeof(ushort) - startIndex);
/// <summary>Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array.</summary>
/// <param name="value">An array of bytes.</param>
@@ -287,7 +287,7 @@ public static class BigEndianBitConverter
/// minus 1.
/// </exception>
public static uint ToUInt32(byte[] value, int startIndex) =>
BitConverter.ToUInt32(value.Reverse().ToArray(), value.Length - sizeof(uint) - startIndex);
BitConverter.ToUInt32(Enumerable.ToArray(Enumerable.Reverse(value)), value.Length - sizeof(uint) - startIndex);
/// <summary>Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array.</summary>
/// <param name="value">An array of bytes.</param>
@@ -303,7 +303,7 @@ public static class BigEndianBitConverter
/// minus 1.
/// </exception>
public static ulong ToUInt64(byte[] value, int startIndex) =>
BitConverter.ToUInt64(value.Reverse().ToArray(), value.Length - sizeof(ulong) - startIndex);
BitConverter.ToUInt64(Enumerable.ToArray(Enumerable.Reverse(value)), value.Length - sizeof(ulong) - startIndex);
public static Guid ToGuid(byte[] value, int startIndex) => new(ToUInt32(value, 0 + startIndex),
ToUInt16(value, 4 + startIndex),

View File

@@ -6,6 +6,7 @@
<FileVersion>1.0.0.0</FileVersion>
<InformationalVersion>1.0.0-beta.1</InformationalVersion>
<Copyright>© $([System.DateTime]::Now.Year) Natalia Portillo</Copyright>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>

View File

@@ -556,6 +556,14 @@ public sealed class FileImporter
}
}
public bool IsInRepo(long crc32)
{
lock(DbLock)
{
return _ctx.Files.Any(f => f.Crc32 == crc32.ToString("x8") && f.IsInRepo);
}
}
public void ImportAndHashRom(Stream stream, string filename, string tempPath, long size)
{
try

View File

@@ -1,91 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RomRepoMgr", "RomRepoMgr\RomRepoMgr.csproj", "{6CDCA6AF-B060-45AC-BCE2-CDBB0AF6B9AE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RomRepoMgr.Database", "RomRepoMgr.Database\RomRepoMgr.Database.csproj", "{FE5ACD61-90F1-4B9F-9BDA-50934040882A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RomRepoMgr.Settings", "RomRepoMgr.Settings\RomRepoMgr.Settings.csproj", "{FEAC8090-8F64-44D4-9DE2-C9E6CEDB4FC5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RomRepoMgr.Core", "RomRepoMgr.Core\RomRepoMgr.Core.csproj", "{1C7E7286-1BA6-43B0-A042-4A3C378BDDC1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Core", "SabreTools\SabreTools.Core\SabreTools.Core.csproj", "{F9FAE131-A9A0-4FC4-B3D5-19BA98CA14C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.DatFiles", "SabreTools\SabreTools.DatFiles\SabreTools.DatFiles.csproj", "{D22CC917-BF9D-423D-8E57-0984170A8731}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.DatItems", "SabreTools\SabreTools.DatItems\SabreTools.DatItems.csproj", "{F468E658-6CA2-4654-9354-F20AB931E441}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.FileTypes", "SabreTools\SabreTools.FileTypes\SabreTools.FileTypes.csproj", "{F963F3F3-A8C3-4098-9050-D4426744D900}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution items", "{0D5756E5-7A2F-4E0B-9368-D3B860A6FDD6}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
LICENSE = LICENSE
codealike.json = codealike.json
RomRepoMgr.sln.DotSettings = RomRepoMgr.sln.DotSettings
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
global.json = global.json
README.md = README.md
logo.png = logo.png
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.DatTools", "SabreTools\SabreTools.DatTools\SabreTools.DatTools.csproj", "{20CC9ED6-9F56-49B5-A265-DC246C424F27}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Reports", "SabreTools\SabreTools.Reports\SabreTools.Reports.csproj", "{E73767A7-0A65-4F89-B149-A520874F7B32}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RomRepoMgr.Blazor", "RomRepoMgr.Blazor\RomRepoMgr.Blazor.csproj", "{30DA0637-76C5-43DE-8203-403AECF5F859}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6CDCA6AF-B060-45AC-BCE2-CDBB0AF6B9AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6CDCA6AF-B060-45AC-BCE2-CDBB0AF6B9AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6CDCA6AF-B060-45AC-BCE2-CDBB0AF6B9AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CDCA6AF-B060-45AC-BCE2-CDBB0AF6B9AE}.Release|Any CPU.Build.0 = Release|Any CPU
{FE5ACD61-90F1-4B9F-9BDA-50934040882A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE5ACD61-90F1-4B9F-9BDA-50934040882A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE5ACD61-90F1-4B9F-9BDA-50934040882A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE5ACD61-90F1-4B9F-9BDA-50934040882A}.Release|Any CPU.Build.0 = Release|Any CPU
{FEAC8090-8F64-44D4-9DE2-C9E6CEDB4FC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FEAC8090-8F64-44D4-9DE2-C9E6CEDB4FC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FEAC8090-8F64-44D4-9DE2-C9E6CEDB4FC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FEAC8090-8F64-44D4-9DE2-C9E6CEDB4FC5}.Release|Any CPU.Build.0 = Release|Any CPU
{1C7E7286-1BA6-43B0-A042-4A3C378BDDC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C7E7286-1BA6-43B0-A042-4A3C378BDDC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C7E7286-1BA6-43B0-A042-4A3C378BDDC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C7E7286-1BA6-43B0-A042-4A3C378BDDC1}.Release|Any CPU.Build.0 = Release|Any CPU
{F9FAE131-A9A0-4FC4-B3D5-19BA98CA14C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9FAE131-A9A0-4FC4-B3D5-19BA98CA14C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9FAE131-A9A0-4FC4-B3D5-19BA98CA14C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9FAE131-A9A0-4FC4-B3D5-19BA98CA14C1}.Release|Any CPU.Build.0 = Release|Any CPU
{D22CC917-BF9D-423D-8E57-0984170A8731}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D22CC917-BF9D-423D-8E57-0984170A8731}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D22CC917-BF9D-423D-8E57-0984170A8731}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D22CC917-BF9D-423D-8E57-0984170A8731}.Release|Any CPU.Build.0 = Release|Any CPU
{F468E658-6CA2-4654-9354-F20AB931E441}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F468E658-6CA2-4654-9354-F20AB931E441}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F468E658-6CA2-4654-9354-F20AB931E441}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F468E658-6CA2-4654-9354-F20AB931E441}.Release|Any CPU.Build.0 = Release|Any CPU
{F963F3F3-A8C3-4098-9050-D4426744D900}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F963F3F3-A8C3-4098-9050-D4426744D900}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F963F3F3-A8C3-4098-9050-D4426744D900}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F963F3F3-A8C3-4098-9050-D4426744D900}.Release|Any CPU.Build.0 = Release|Any CPU
{20CC9ED6-9F56-49B5-A265-DC246C424F27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20CC9ED6-9F56-49B5-A265-DC246C424F27}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20CC9ED6-9F56-49B5-A265-DC246C424F27}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20CC9ED6-9F56-49B5-A265-DC246C424F27}.Release|Any CPU.Build.0 = Release|Any CPU
{E73767A7-0A65-4F89-B149-A520874F7B32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E73767A7-0A65-4F89-B149-A520874F7B32}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E73767A7-0A65-4F89-B149-A520874F7B32}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E73767A7-0A65-4F89-B149-A520874F7B32}.Release|Any CPU.Build.0 = Release|Any CPU
{30DA0637-76C5-43DE-8203-403AECF5F859}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{30DA0637-76C5-43DE-8203-403AECF5F859}.Debug|Any CPU.Build.0 = Debug|Any CPU
{30DA0637-76C5-43DE-8203-403AECF5F859}.Release|Any CPU.ActiveCfg = Release|Any CPU
{30DA0637-76C5-43DE-8203-403AECF5F859}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

26
RomRepoMgr.slnx Normal file
View File

@@ -0,0 +1,26 @@
<Solution>
<Folder Name="/Solution items/">
<File Path=".editorconfig" />
<File Path=".gitignore" />
<File Path="codealike.json" />
<File Path="Directory.Build.props" />
<File Path="Directory.Build.targets" />
<File Path="Directory.Packages.props" />
<File Path="global.json" />
<File Path="LICENSE" />
<File Path="logo.png" />
<File Path="README.md" />
<File Path="RomRepoMgr.sln.DotSettings" />
</Folder>
<Project Path="RomRepoMgr.Blazor/RomRepoMgr.Blazor.csproj" />
<Project Path="RomRepoMgr.Core/RomRepoMgr.Core.csproj" />
<Project Path="RomRepoMgr.Database/RomRepoMgr.Database.csproj" />
<Project Path="RomRepoMgr.Settings/RomRepoMgr.Settings.csproj" />
<Project Path="RomRepoMgr/RomRepoMgr.csproj" />
<Project Path="SabreTools/SabreTools.Core/SabreTools.Core.csproj" />
<Project Path="SabreTools/SabreTools.DatFiles/SabreTools.DatFiles.csproj" />
<Project Path="SabreTools/SabreTools.DatItems/SabreTools.DatItems.csproj" />
<Project Path="SabreTools/SabreTools.DatTools/SabreTools.DatTools.csproj" />
<Project Path="SabreTools/SabreTools.FileTypes/SabreTools.FileTypes.csproj" />
<Project Path="SabreTools/SabreTools.Reports/SabreTools.Reports.csproj" />
</Solution>

View File

@@ -65,6 +65,7 @@ internal static class Program
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>()
.UsePlatformDetect()
#if DEBUG
.LogToSerilog(LogEventLevel.Debug);
#else

View File

@@ -788,5 +788,23 @@ namespace RomRepoMgr.Resources {
return ResourceManager.GetString("ProcessingArchive", resourceCulture);
}
}
public static string ErrorProcessingArchive {
get {
return ResourceManager.GetString("ErrorProcessingArchive", resourceCulture);
}
}
public static string UnknownFile {
get {
return ResourceManager.GetString("UnknownFile", resourceCulture);
}
}
public static string FileAlreadyInRepository {
get {
return ResourceManager.GetString("FileAlreadyInRepository", resourceCulture);
}
}
}
}

View File

@@ -390,4 +390,13 @@ Tardará mucho tiempo...</value>
<data name="ProcessingArchive" xml:space="preserve">
<value>Procesando archivo: {0}</value>
</data>
<data name="ErrorProcessingArchive" xml:space="preserve">
<value>Error procesando archivo.</value>
</data>
<data name="UnknownFile" xml:space="preserve">
<value>Fichero desconocido.</value>
</data>
<data name="FileAlreadyInRepository" xml:space="preserve">
<value>Fichero ya en el repositorio.</value>
</data>
</root>

View File

@@ -398,4 +398,13 @@ This will take a long time...</value>
<data name="ProcessingArchive" xml:space="preserve">
<value>Processing archive: {0}</value>
</data>
<data name="ErrorProcessingArchive" xml:space="preserve">
<value>Error processing archive.</value>
</data>
<data name="UnknownFile" xml:space="preserve">
<value>Unknown file.</value>
</data>
<data name="FileAlreadyInRepository" xml:space="preserve">
<value>File already in repository.</value>
</data>
</root>

View File

@@ -48,7 +48,6 @@
<PackageReference Include="Serilog.Sinks.Console"/>
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer"/>
<PackageReference Include="Text.Analyzers"/>
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Condition="$(RuntimeIdentifier.StartsWith('linux'))"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RomRepoMgr.Database\RomRepoMgr.Database.csproj"/>

View File

@@ -404,11 +404,41 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
// Process files in archive
while(reader.MoveToNextEntry())
{
string filename = Path.GetFileName(reader.Entry.Key);
if(reader.Entry.IsDirectory) continue;
if(reader.Entry.Crc == 0 && KnownOnlyChecked) continue;
if(reader.Entry.Crc == 0 && KnownOnlyChecked ||
!archiveImporter.IsCrcInDb(reader.Entry.Crc) && KnownOnlyChecked)
{
Dispatcher.UIThread.Post(() => Importers.Add(new RomImporter
{
Filename = filename,
Indeterminate = false,
Progress = 1,
Maximum = 1,
Minimum = 0,
StatusMessage = Localization.UnknownFile
}));
if(!archiveImporter.IsCrcInDb(reader.Entry.Crc) && KnownOnlyChecked) continue;
continue;
}
// Do not import files that are already in the repository
if(archiveImporter.IsInRepo(reader.Entry.Crc))
{
Dispatcher.UIThread.Post(() => Importers.Add(new RomImporter
{
Filename = filename,
Indeterminate = false,
Progress = 1,
Maximum = 1,
Minimum = 0,
StatusMessage = Localization.FileAlreadyInRepository
}));
continue;
}
var model = new RomImporter
{
@@ -440,10 +470,32 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
tmpFile,
reader.Entry.Size);
if(File.Exists(tmpFile)) File.Delete(tmpFile);
try
{
if(File.Exists(tmpFile)) File.Delete(tmpFile);
}
catch(IOException)
#pragma warning disable PH2098
{
// Ignore IO exceptions when deleting temporary files
}
#pragma warning restore PH2098
}
}
catch(InvalidOperationException) {}
catch(Exception)
{
Dispatcher.UIThread.Post(() => Importers.Add(new RomImporter
{
Filename = Path.GetFileName(archive),
Indeterminate = false,
Progress = 1,
Maximum = 1,
Minimum = 0,
StatusMessage = Localization.ErrorProcessingArchive
}));
#pragma warning disable ERP022
}
#pragma warning restore ERP022
finally
{
Interlocked.Increment(ref _listPosition);

View File

@@ -1,5 +0,0 @@
{
"sdk": {
"version": "9.0.301"
}
}