mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Compare commits
3 Commits
ab9abd56f5
...
8eaca3556a
| Author | SHA1 | Date | |
|---|---|---|---|
|
8eaca3556a
|
|||
|
32bbb55e61
|
|||
|
640c40d7f7
|
@@ -311,6 +311,7 @@ resharper_bad_switch_braces_indent_highlighting
|
||||
resharper_bad_symbol_spaces_highlighting = warning
|
||||
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
|
||||
resharper_built_in_type_reference_style_highlighting = hint
|
||||
resharper_can_simplify_dictionary_lookup_with_try_add_highlighting = warning
|
||||
resharper_check_for_reference_equality_instead_1_highlighting = warning
|
||||
resharper_check_for_reference_equality_instead_2_highlighting = warning
|
||||
resharper_check_for_reference_equality_instead_3_highlighting = warning
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<PackageVersion Include="System.Security.Principal.Windows" Version="5.0.0"/>
|
||||
<PackageVersion Include="Text.Analyzers" Version="4.14.0"/>
|
||||
<PackageVersion Include="winfsp.net" Version="2.1.25156"/>
|
||||
<PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="3.116.1" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'" />
|
||||
<PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="3.116.1" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'"/>
|
||||
|
||||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3"/>
|
||||
<PackageVersion Include="SabreTools.Hashing" Version="1.2.3"/>
|
||||
|
||||
812
RomRepoMgr.Core/Resources/Localization.Designer.cs
generated
812
RomRepoMgr.Core/Resources/Localization.Designer.cs
generated
@@ -11,46 +11,32 @@ namespace RomRepoMgr.Core.Resources {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Localization {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
private static System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
private static System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Localization() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RomRepoMgr.Core.Resources.Localization", typeof(Localization).Assembly);
|
||||
if (object.Equals(null, resourceMan)) {
|
||||
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("RomRepoMgr.Core.Resources.Localization", typeof(Localization).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
@@ -59,525 +45,351 @@ namespace RomRepoMgr.Core.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Adding DAT to database....
|
||||
/// </summary>
|
||||
internal static string AddingDatToDatabase {
|
||||
get {
|
||||
return ResourceManager.GetString("AddingDatToDatabase", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Adding disks....
|
||||
/// </summary>
|
||||
internal static string AddingDisks {
|
||||
get {
|
||||
return ResourceManager.GetString("AddingDisks", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Adding machines (games)....
|
||||
/// </summary>
|
||||
internal static string AddingMachines {
|
||||
get {
|
||||
return ResourceManager.GetString("AddingMachines", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Adding medias....
|
||||
/// </summary>
|
||||
internal static string AddingMedias {
|
||||
get {
|
||||
return ResourceManager.GetString("AddingMedias", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Adding ROMs....
|
||||
/// </summary>
|
||||
internal static string AddingRoms {
|
||||
get {
|
||||
return ResourceManager.GetString("AddingRoms", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Assertion failed.
|
||||
/// </summary>
|
||||
internal static string Assertion_failed {
|
||||
get {
|
||||
return ResourceManager.GetString("Assertion_failed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Specified string is not valid Base32 format because character "{0}" does not exist in Base32 alphabet.
|
||||
/// </summary>
|
||||
internal static string Base32_Invalid_format {
|
||||
get {
|
||||
return ResourceManager.GetString("Base32_Invalid_format", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Specified string is not valid Base32 format because it doesn't have enough data to construct a complete byte array.
|
||||
/// </summary>
|
||||
internal static string Base32_Not_enought_data {
|
||||
get {
|
||||
return ResourceManager.GetString("Base32_Not_enought_data", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cannot seek after stream end..
|
||||
/// </summary>
|
||||
internal static string Cannot_seek_after_end {
|
||||
internal static string Base32_Invalid_format {
|
||||
get {
|
||||
return ResourceManager.GetString("Cannot_seek_after_end", resourceCulture);
|
||||
return ResourceManager.GetString("Base32_Invalid_format", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cannot seek before stream start..
|
||||
/// </summary>
|
||||
internal static string Cannot_seek_before_start {
|
||||
get {
|
||||
return ResourceManager.GetString("Cannot_seek_before_start", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cannot find file with hash {0} in the repository.
|
||||
/// </summary>
|
||||
internal static string CannotFindHashInRepository {
|
||||
internal static string Cannot_seek_after_end {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotFindHashInRepository", resourceCulture);
|
||||
return ResourceManager.GetString("Cannot_seek_after_end", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cannot find lsar executable..
|
||||
/// </summary>
|
||||
internal static string CannotFindLsAr {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotFindLsAr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cannot find unar executable at {0}..
|
||||
/// </summary>
|
||||
internal static string CannotFindUnArAtPath {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotFindUnArAtPath", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cannot find requested zip entry in hashes dictionary.
|
||||
/// </summary>
|
||||
internal static string CannotFindZipEntryInDictionary {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotFindZipEntryInDictionary", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cannot run lsar..
|
||||
/// </summary>
|
||||
internal static string CannotRunLsAr {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotRunLsAr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cannot run unar..
|
||||
/// </summary>
|
||||
internal static string CannotRunUnAr {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotRunUnAr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Checking if file is an archive....
|
||||
/// </summary>
|
||||
internal static string CheckingIfFIleIsAnArchive {
|
||||
get {
|
||||
return ResourceManager.GetString("CheckingIfFIleIsAnArchive", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Compressing {0}....
|
||||
/// </summary>
|
||||
internal static string Compressing {
|
||||
get {
|
||||
return ResourceManager.GetString("Compressing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Compressing DAT file....
|
||||
/// </summary>
|
||||
internal static string CompressingDatFile {
|
||||
get {
|
||||
return ResourceManager.GetString("CompressingDatFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Compressing file....
|
||||
/// </summary>
|
||||
internal static string CompressingFile {
|
||||
get {
|
||||
return ResourceManager.GetString("CompressingFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Copying {0}....
|
||||
/// </summary>
|
||||
internal static string Copying {
|
||||
get {
|
||||
return ResourceManager.GetString("Copying", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Copying file....
|
||||
/// </summary>
|
||||
internal static string CopyingFile {
|
||||
get {
|
||||
return ResourceManager.GetString("CopyingFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Could not find ROM set in database..
|
||||
/// </summary>
|
||||
internal static string CouldNotFindRomSetInDatabase {
|
||||
get {
|
||||
return ResourceManager.GetString("CouldNotFindRomSetInDatabase", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File exists.
|
||||
/// </summary>
|
||||
internal static string DatabaseFileExistsMsgBoxTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("DatabaseFileExistsMsgBoxTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to DAT file is already in database, not importing duplicates..
|
||||
/// </summary>
|
||||
internal static string DatAlreadyInDatabase {
|
||||
get {
|
||||
return ResourceManager.GetString("DatAlreadyInDatabase", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Imported {0} machines with {1} ROMs..
|
||||
/// </summary>
|
||||
internal static string DatImportSuccess {
|
||||
get {
|
||||
return ResourceManager.GetString("DatImportSuccess", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Enumerating files....
|
||||
/// </summary>
|
||||
internal static string EnumeratingFiles {
|
||||
get {
|
||||
return ResourceManager.GetString("EnumeratingFiles", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error: {0}.
|
||||
/// </summary>
|
||||
internal static string ErrorWithMessage {
|
||||
get {
|
||||
return ResourceManager.GetString("ErrorWithMessage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Exporting ROMs....
|
||||
/// </summary>
|
||||
internal static string ExportingRoms {
|
||||
get {
|
||||
return ResourceManager.GetString("ExportingRoms", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Extracted contents.
|
||||
/// </summary>
|
||||
internal static string ExtractedContents {
|
||||
get {
|
||||
return ResourceManager.GetString("ExtractedContents", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Extracting archive contents....
|
||||
/// </summary>
|
||||
internal static string ExtractingArchive {
|
||||
get {
|
||||
return ResourceManager.GetString("ExtractingArchive", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Finished.
|
||||
/// </summary>
|
||||
internal static string Finished {
|
||||
get {
|
||||
return ResourceManager.GetString("Finished", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Finishing....
|
||||
/// </summary>
|
||||
internal static string Finishing {
|
||||
get {
|
||||
return ResourceManager.GetString("Finishing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Found a disk with an unknown machine, this should not happen..
|
||||
/// </summary>
|
||||
internal static string FoundDiskWithoutMachine {
|
||||
get {
|
||||
return ResourceManager.GetString("FoundDiskWithoutMachine", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Found media with an unknown machine, this should not happen..
|
||||
/// </summary>
|
||||
internal static string FoundMediaWithoutMachine {
|
||||
get {
|
||||
return ResourceManager.GetString("FoundMediaWithoutMachine", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Found a ROM with an unknown machine, this should not happen..
|
||||
/// </summary>
|
||||
internal static string FoundRomWithoutMachine {
|
||||
get {
|
||||
return ResourceManager.GetString("FoundRomWithoutMachine", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Getting machine (game) names....
|
||||
/// </summary>
|
||||
internal static string GettingMachineNames {
|
||||
get {
|
||||
return ResourceManager.GetString("GettingMachineNames", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Hashing DAT file....
|
||||
/// </summary>
|
||||
internal static string HashingDatFile {
|
||||
get {
|
||||
return ResourceManager.GetString("HashingDatFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Hashing file....
|
||||
/// </summary>
|
||||
internal static string HashingFile {
|
||||
get {
|
||||
return ResourceManager.GetString("HashingFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Importing {0}....
|
||||
/// </summary>
|
||||
internal static string Importing {
|
||||
get {
|
||||
return ResourceManager.GetString("Importing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to No checksums found..
|
||||
/// </summary>
|
||||
internal static string NoChecksumsFound {
|
||||
get {
|
||||
return ResourceManager.GetString("NoChecksumsFound", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Not yet implemented..
|
||||
/// </summary>
|
||||
internal static string Not_yet_implemented {
|
||||
get {
|
||||
return ResourceManager.GetString("Not_yet_implemented", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Not a CHD file..
|
||||
/// </summary>
|
||||
internal static string NotAChdFile {
|
||||
get {
|
||||
return ResourceManager.GetString("NotAChdFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Not an AaruFormat file..
|
||||
/// </summary>
|
||||
internal static string NotAnAaruFormatFile {
|
||||
get {
|
||||
return ResourceManager.GetString("NotAnAaruFormatFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Not the correct lsar executable.
|
||||
/// </summary>
|
||||
internal static string NotCorrectLsAr {
|
||||
get {
|
||||
return ResourceManager.GetString("NotCorrectLsAr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Not the correct unar executable.
|
||||
/// </summary>
|
||||
internal static string NotCorrectUnAr {
|
||||
get {
|
||||
return ResourceManager.GetString("NotCorrectUnAr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to OK.
|
||||
/// </summary>
|
||||
internal static string OK {
|
||||
get {
|
||||
return ResourceManager.GetString("OK", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Parsing DAT file....
|
||||
/// </summary>
|
||||
internal static string ParsinDatFile {
|
||||
get {
|
||||
return ResourceManager.GetString("ParsinDatFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Removing temporary path....
|
||||
/// </summary>
|
||||
internal static string RemovingTemporaryPath {
|
||||
get {
|
||||
return ResourceManager.GetString("RemovingTemporaryPath", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Retrieving ROMs and disks....
|
||||
/// </summary>
|
||||
internal static string RetrievingRomsAndDisks {
|
||||
get {
|
||||
return ResourceManager.GetString("RetrievingRomsAndDisks", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Retrieving ROM set from database..
|
||||
/// </summary>
|
||||
internal static string RetrievingRomSetFromDatabase {
|
||||
get {
|
||||
return ResourceManager.GetString("RetrievingRomSetFromDatabase", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Saving changes to database....
|
||||
/// </summary>
|
||||
internal static string SavingChangesToDatabase {
|
||||
get {
|
||||
return ResourceManager.GetString("SavingChangesToDatabase", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The input exceeds data types..
|
||||
/// </summary>
|
||||
internal static string Spamsum_Input_exceeds_data {
|
||||
get {
|
||||
return ResourceManager.GetString("Spamsum_Input_exceeds_data", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to SpamSum does not have a binary representation..
|
||||
/// </summary>
|
||||
internal static string Spamsum_no_binary {
|
||||
get {
|
||||
return ResourceManager.GetString("Spamsum_no_binary", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to unar path is not set..
|
||||
/// </summary>
|
||||
internal static string Assertion_failed {
|
||||
get {
|
||||
return ResourceManager.GetString("Assertion_failed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string Spamsum_Input_exceeds_data {
|
||||
get {
|
||||
return ResourceManager.GetString("Spamsum_Input_exceeds_data", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string Not_yet_implemented {
|
||||
get {
|
||||
return ResourceManager.GetString("Not_yet_implemented", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string DatabaseFileExistsMsgBoxTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("DatabaseFileExistsMsgBoxTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string UnArPathNotSet {
|
||||
get {
|
||||
return ResourceManager.GetString("UnArPathNotSet", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unhandled exception occurred..
|
||||
/// </summary>
|
||||
internal static string CannotFindUnArAtPath {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotFindUnArAtPath", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string CannotFindLsAr {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotFindLsAr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string CannotRunUnAr {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotRunUnAr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string CannotRunLsAr {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotRunLsAr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string NotCorrectUnAr {
|
||||
get {
|
||||
return ResourceManager.GetString("NotCorrectUnAr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string NotCorrectLsAr {
|
||||
get {
|
||||
return ResourceManager.GetString("NotCorrectLsAr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ParsinDatFile {
|
||||
get {
|
||||
return ResourceManager.GetString("ParsinDatFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string HashingDatFile {
|
||||
get {
|
||||
return ResourceManager.GetString("HashingDatFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string DatAlreadyInDatabase {
|
||||
get {
|
||||
return ResourceManager.GetString("DatAlreadyInDatabase", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string AddingDatToDatabase {
|
||||
get {
|
||||
return ResourceManager.GetString("AddingDatToDatabase", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string CompressingDatFile {
|
||||
get {
|
||||
return ResourceManager.GetString("CompressingDatFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string GettingMachineNames {
|
||||
get {
|
||||
return ResourceManager.GetString("GettingMachineNames", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string AddingMachines {
|
||||
get {
|
||||
return ResourceManager.GetString("AddingMachines", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string SavingChangesToDatabase {
|
||||
get {
|
||||
return ResourceManager.GetString("SavingChangesToDatabase", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string RetrievingRomsAndDisks {
|
||||
get {
|
||||
return ResourceManager.GetString("RetrievingRomsAndDisks", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string AddingRoms {
|
||||
get {
|
||||
return ResourceManager.GetString("AddingRoms", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string FoundRomWithoutMachine {
|
||||
get {
|
||||
return ResourceManager.GetString("FoundRomWithoutMachine", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string UnhandledException {
|
||||
get {
|
||||
return ResourceManager.GetString("UnhandledException", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unhandled exception when importing file..
|
||||
/// </summary>
|
||||
internal static string RetrievingRomSetFromDatabase {
|
||||
get {
|
||||
return ResourceManager.GetString("RetrievingRomSetFromDatabase", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string CouldNotFindRomSetInDatabase {
|
||||
get {
|
||||
return ResourceManager.GetString("CouldNotFindRomSetInDatabase", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ExportingRoms {
|
||||
get {
|
||||
return ResourceManager.GetString("ExportingRoms", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string Finished {
|
||||
get {
|
||||
return ResourceManager.GetString("Finished", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string CannotFindZipEntryInDictionary {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotFindZipEntryInDictionary", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string CannotFindHashInRepository {
|
||||
get {
|
||||
return ResourceManager.GetString("CannotFindHashInRepository", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string Compressing {
|
||||
get {
|
||||
return ResourceManager.GetString("Compressing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string EnumeratingFiles {
|
||||
get {
|
||||
return ResourceManager.GetString("EnumeratingFiles", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string Importing {
|
||||
get {
|
||||
return ResourceManager.GetString("Importing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string CheckingIfFIleIsAnArchive {
|
||||
get {
|
||||
return ResourceManager.GetString("CheckingIfFIleIsAnArchive", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string OK {
|
||||
get {
|
||||
return ResourceManager.GetString("OK", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ErrorWithMessage {
|
||||
get {
|
||||
return ResourceManager.GetString("ErrorWithMessage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ExtractingArchive {
|
||||
get {
|
||||
return ResourceManager.GetString("ExtractingArchive", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string RemovingTemporaryPath {
|
||||
get {
|
||||
return ResourceManager.GetString("RemovingTemporaryPath", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ExtractedContents {
|
||||
get {
|
||||
return ResourceManager.GetString("ExtractedContents", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string HashingFile {
|
||||
get {
|
||||
return ResourceManager.GetString("HashingFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string UnknownFile {
|
||||
get {
|
||||
return ResourceManager.GetString("UnknownFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string CompressingFile {
|
||||
get {
|
||||
return ResourceManager.GetString("CompressingFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string Finishing {
|
||||
get {
|
||||
return ResourceManager.GetString("Finishing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string UnhandledExceptionWhenImporting {
|
||||
get {
|
||||
return ResourceManager.GetString("UnhandledExceptionWhenImporting", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unknown file..
|
||||
/// </summary>
|
||||
internal static string UnknownFile {
|
||||
internal static string AddingDisks {
|
||||
get {
|
||||
return ResourceManager.GetString("UnknownFile", resourceCulture);
|
||||
return ResourceManager.GetString("AddingDisks", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string FoundDiskWithoutMachine {
|
||||
get {
|
||||
return ResourceManager.GetString("FoundDiskWithoutMachine", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string NotAChdFile {
|
||||
get {
|
||||
return ResourceManager.GetString("NotAChdFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string NoChecksumsFound {
|
||||
get {
|
||||
return ResourceManager.GetString("NoChecksumsFound", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string Copying {
|
||||
get {
|
||||
return ResourceManager.GetString("Copying", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string CopyingFile {
|
||||
get {
|
||||
return ResourceManager.GetString("CopyingFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string AddingMedias {
|
||||
get {
|
||||
return ResourceManager.GetString("AddingMedias", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string FoundMediaWithoutMachine {
|
||||
get {
|
||||
return ResourceManager.GetString("FoundMediaWithoutMachine", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string NotAnAaruFormatFile {
|
||||
get {
|
||||
return ResourceManager.GetString("NotAnAaruFormatFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string DatImportSuccess {
|
||||
get {
|
||||
return ResourceManager.GetString("DatImportSuccess", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<root>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root"
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
|
||||
id="root"
|
||||
xmlns="">
|
||||
<xsd:element name="root" msdata:IsDataSet="true"></xsd:element>
|
||||
</xsd:schema>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<ProjectReference Include="..\RomRepoMgr.Settings\RomRepoMgr.Settings.csproj"/>
|
||||
<ProjectReference Include="..\SabreTools\SabreTools.DatFiles\SabreTools.DatFiles.csproj"/>
|
||||
<ProjectReference Include="..\SabreTools\SabreTools.DatItems\SabreTools.DatItems.csproj"/>
|
||||
<ProjectReference Include="..\SabreTools\SabreTools.DatTools\SabreTools.DatTools.csproj" />
|
||||
<ProjectReference Include="..\SabreTools\SabreTools.DatTools\SabreTools.DatTools.csproj"/>
|
||||
<ProjectReference Include="..\SabreTools\SabreTools.FileTypes\SabreTools.FileTypes.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -53,10 +53,11 @@ namespace RomRepoMgr.Core.Workers;
|
||||
|
||||
public sealed class DatImporter
|
||||
{
|
||||
readonly string _category;
|
||||
readonly string _datFilesPath;
|
||||
readonly string _datPath;
|
||||
bool _aborted;
|
||||
private static readonly object _dbLock = new();
|
||||
readonly string _category;
|
||||
readonly string _datFilesPath;
|
||||
readonly string _datPath;
|
||||
bool _aborted;
|
||||
|
||||
public DatImporter(string datPath, string category)
|
||||
{
|
||||
@@ -132,8 +133,11 @@ public sealed class DatImporter
|
||||
Category = _category
|
||||
};
|
||||
|
||||
ctx.RomSets.Add(romSet);
|
||||
ctx.SaveChanges();
|
||||
lock(_dbLock)
|
||||
{
|
||||
ctx.RomSets.Add(romSet);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
||||
SetMessage?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
@@ -199,8 +203,11 @@ public sealed class DatImporter
|
||||
|
||||
SetIndeterminateProgress?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
ctx.BulkInsert(machines.Values.ToList(), b => b.SetOutputIdentity = true);
|
||||
ctx.SaveChanges();
|
||||
lock(_dbLock)
|
||||
{
|
||||
ctx.BulkInsert(machines.Values.ToList(), b => b.SetOutputIdentity = true);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
||||
SetMessage?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
@@ -248,358 +255,329 @@ public sealed class DatImporter
|
||||
Maximum = datFile.Items.SortedKeys.Length
|
||||
});
|
||||
|
||||
using(DbTransaction dbTransaction = dbConnection.BeginTransaction())
|
||||
List<DbFile> pendingFilesByCrcList;
|
||||
List<DbFile> pendingFilesByMd5List;
|
||||
List<DbFile> pendingFilesBySha1List;
|
||||
List<DbFile> pendingFilesBySha256List;
|
||||
List<DbFile> pendingFilesBySha384List;
|
||||
List<DbFile> pendingFilesBySha512List;
|
||||
Dictionary<string, DbDisk> pendingDisksByMd5;
|
||||
Dictionary<string, DbDisk> pendingDisksBySha1;
|
||||
Dictionary<string, DbMedia> pendingMediasByMd5;
|
||||
Dictionary<string, DbMedia> pendingMediasBySha1;
|
||||
Dictionary<string, DbMedia> pendingMediasBySha256;
|
||||
|
||||
lock(_dbLock)
|
||||
{
|
||||
DbCommand dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomCrc32Table}\" (\"Size\" INTEGER NOT NULL, \"Crc32\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomMd5Table}\" (\"Size\" INTEGER NOT NULL, \"Md5\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomSha1Table}\" (\"Size\" INTEGER NOT NULL, \"Sha1\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomSha256Table}\" (\"Size\" INTEGER NOT NULL, \"Sha256\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomSha384Table}\" (\"Size\" INTEGER NOT NULL, \"Sha384\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomSha512Table}\" (\"Size\" INTEGER NOT NULL, \"Sha512\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
dbcc.CommandText = $"CREATE TABLE \"{tmpDiskMd5Table}\" (\"Md5\" TEXT NOT NULL);";
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
dbcc.CommandText = $"CREATE TABLE \"{tmpDiskSha1Table}\" (\"Sha1\" TEXT NOT NULL);";
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
dbcc.CommandText = $"CREATE TABLE \"{tmpMediaMd5Table}\" (\"Md5\" TEXT NOT NULL);";
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
dbcc.CommandText = $"CREATE TABLE \"{tmpMediaSha1Table}\" (\"Sha1\" TEXT NOT NULL);";
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
dbcc.CommandText = $"CREATE TABLE \"{tmpMediaSha256Table}\" (\"Sha256\" TEXT NOT NULL);";
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
foreach(string key in datFile.Items.SortedKeys)
|
||||
using(DbTransaction dbTransaction = dbConnection.BeginTransaction())
|
||||
{
|
||||
SetProgress?.Invoke(this,
|
||||
new ProgressEventArgs
|
||||
{
|
||||
Value = position
|
||||
});
|
||||
DbCommand dbcc = dbConnection.CreateCommand();
|
||||
|
||||
foreach(DatItem item in datFile.GetItemsForBucket(key))
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomCrc32Table}\" (\"Size\" INTEGER NOT NULL, \"Crc32\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomMd5Table}\" (\"Size\" INTEGER NOT NULL, \"Md5\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomSha1Table}\" (\"Size\" INTEGER NOT NULL, \"Sha1\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomSha256Table}\" (\"Size\" INTEGER NOT NULL, \"Sha256\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomSha384Table}\" (\"Size\" INTEGER NOT NULL, \"Sha384\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"CREATE TABLE \"{tmpRomSha512Table}\" (\"Size\" INTEGER NOT NULL, \"Sha512\" TEXT NOT NULL);";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
dbcc.CommandText = $"CREATE TABLE \"{tmpDiskMd5Table}\" (\"Md5\" TEXT NOT NULL);";
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
dbcc.CommandText = $"CREATE TABLE \"{tmpDiskSha1Table}\" (\"Sha1\" TEXT NOT NULL);";
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
dbcc.CommandText = $"CREATE TABLE \"{tmpMediaMd5Table}\" (\"Md5\" TEXT NOT NULL);";
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
dbcc.CommandText = $"CREATE TABLE \"{tmpMediaSha1Table}\" (\"Sha1\" TEXT NOT NULL);";
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
dbcc.CommandText = $"CREATE TABLE \"{tmpMediaSha256Table}\" (\"Sha256\" TEXT NOT NULL);";
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
foreach(string key in datFile.Items.SortedKeys)
|
||||
{
|
||||
switch(item)
|
||||
SetProgress?.Invoke(this,
|
||||
new ProgressEventArgs
|
||||
{
|
||||
Value = position
|
||||
});
|
||||
|
||||
foreach(DatItem item in datFile.GetItemsForBucket(key))
|
||||
{
|
||||
case Rom rom:
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.CRCKey) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
switch(item)
|
||||
{
|
||||
case Rom rom:
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.CRCKey) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomCrc32Table}\" (\"Size\", \"Crc32\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.CRCKey)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomCrc32Table}\" (\"Size\", \"Crc32\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.CRCKey)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
romsHaveCrc = true;
|
||||
}
|
||||
romsHaveCrc = true;
|
||||
}
|
||||
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.MD5Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.MD5Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomMd5Table}\" (\"Size\", \"Md5\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.MD5Key)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomMd5Table}\" (\"Size\", \"Md5\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.MD5Key)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
romsHaveMd5 = true;
|
||||
}
|
||||
romsHaveMd5 = true;
|
||||
}
|
||||
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA1Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA1Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomSha1Table}\" (\"Size\", \"Sha1\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA1Key)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomSha1Table}\" (\"Size\", \"Sha1\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA1Key)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
romsHaveSha1 = true;
|
||||
}
|
||||
romsHaveSha1 = true;
|
||||
}
|
||||
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA256Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA256Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomSha256Table}\" (\"Size\", \"Sha256\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA256Key)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomSha256Table}\" (\"Size\", \"Sha256\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA256Key)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
romsHaveSha256 = true;
|
||||
}
|
||||
romsHaveSha256 = true;
|
||||
}
|
||||
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA384Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA384Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomSha384Table}\" (\"Size\", \"Sha384\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA384Key)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomSha384Table}\" (\"Size\", \"Sha384\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA384Key)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
romsHaveSha384 = true;
|
||||
}
|
||||
romsHaveSha384 = true;
|
||||
}
|
||||
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA512Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
if(rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA512Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomSha512Table}\" (\"Size\", \"Sha512\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA512Key)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpRomSha512Table}\" (\"Size\", \"Sha512\") VALUES (\"{(ulong)rom.GetInt64FieldValue(SabreTools.Models.Metadata.Rom.SizeKey)}\", \"{rom.GetStringFieldValue(SabreTools.Models.Metadata.Rom.SHA512Key)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
romsHaveSha512 = true;
|
||||
}
|
||||
romsHaveSha512 = true;
|
||||
}
|
||||
|
||||
roms.Add(rom);
|
||||
roms.Add(rom);
|
||||
|
||||
continue;
|
||||
case Disk disk:
|
||||
if(disk.GetStringFieldValue(SabreTools.Models.Metadata.Disk.MD5Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
continue;
|
||||
case Disk disk:
|
||||
if(disk.GetStringFieldValue(SabreTools.Models.Metadata.Disk.MD5Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpDiskMd5Table}\" (\"Md5\") VALUES (\"{disk.GetStringFieldValue(SabreTools.Models.Metadata.Disk.MD5Key)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpDiskMd5Table}\" (\"Md5\") VALUES (\"{disk.GetStringFieldValue(SabreTools.Models.Metadata.Disk.MD5Key)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
disksHaveMd5 = true;
|
||||
}
|
||||
disksHaveMd5 = true;
|
||||
}
|
||||
|
||||
if(disk.GetStringFieldValue(SabreTools.Models.Metadata.Disk.SHA1Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
if(disk.GetStringFieldValue(SabreTools.Models.Metadata.Disk.SHA1Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpDiskSha1Table}\" (\"Sha1\") VALUES (\"{disk.GetStringFieldValue(SabreTools.Models.Metadata.Disk.SHA1Key)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpDiskSha1Table}\" (\"Sha1\") VALUES (\"{disk.GetStringFieldValue(SabreTools.Models.Metadata.Disk.SHA1Key)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
disksHaveSha1 = true;
|
||||
}
|
||||
disksHaveSha1 = true;
|
||||
}
|
||||
|
||||
disks.Add(disk);
|
||||
disks.Add(disk);
|
||||
|
||||
continue;
|
||||
case Media media:
|
||||
if(media.GetStringFieldValue(SabreTools.Models.Metadata.Media.MD5Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
continue;
|
||||
case Media media:
|
||||
if(media.GetStringFieldValue(SabreTools.Models.Metadata.Media.MD5Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpMediaMd5Table}\" (\"Md5\") VALUES (\"{media.GetStringFieldValue(SabreTools.Models.Metadata.Media.MD5Key)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpMediaMd5Table}\" (\"Md5\") VALUES (\"{media.GetStringFieldValue(SabreTools.Models.Metadata.Media.MD5Key)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
mediasHaveMd5 = true;
|
||||
}
|
||||
mediasHaveMd5 = true;
|
||||
}
|
||||
|
||||
if(media.GetStringFieldValue(SabreTools.Models.Metadata.Media.SHA1Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
if(media.GetStringFieldValue(SabreTools.Models.Metadata.Media.SHA1Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpMediaSha1Table}\" (\"Sha1\") VALUES (\"{media.GetStringFieldValue(SabreTools.Models.Metadata.Media.SHA1Key)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpMediaSha1Table}\" (\"Sha1\") VALUES (\"{media.GetStringFieldValue(SabreTools.Models.Metadata.Media.SHA1Key)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
mediasHaveSha1 = true;
|
||||
}
|
||||
mediasHaveSha1 = true;
|
||||
}
|
||||
|
||||
if(media.GetStringFieldValue(SabreTools.Models.Metadata.Media.SHA256Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
if(media.GetStringFieldValue(SabreTools.Models.Metadata.Media.SHA256Key) != null)
|
||||
{
|
||||
dbcc = dbConnection.CreateCommand();
|
||||
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpMediaSha256Table}\" (\"Sha256\") VALUES (\"{media.GetStringFieldValue(SabreTools.Models.Metadata.Media.SHA256Key)}\");";
|
||||
dbcc.CommandText =
|
||||
$"INSERT INTO \"{tmpMediaSha256Table}\" (\"Sha256\") VALUES (\"{media.GetStringFieldValue(SabreTools.Models.Metadata.Media.SHA256Key)}\");";
|
||||
|
||||
dbcc.ExecuteNonQuery();
|
||||
dbcc.ExecuteNonQuery();
|
||||
|
||||
mediasHaveSha256 = true;
|
||||
}
|
||||
mediasHaveSha256 = true;
|
||||
}
|
||||
|
||||
medias.Add(media);
|
||||
medias.Add(media);
|
||||
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
position++;
|
||||
}
|
||||
|
||||
position++;
|
||||
SetIndeterminateProgress?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
dbTransaction.Commit();
|
||||
}
|
||||
|
||||
SetIndeterminateProgress?.Invoke(this, System.EventArgs.Empty);
|
||||
pendingFilesByCrcList = romsHaveCrc
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomCrc32Table}] AS t WHERE f.Crc32 = t.Crc32 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
dbTransaction.Commit();
|
||||
pendingFilesByMd5List = romsHaveMd5
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomMd5Table}] AS t WHERE f.Md5 = t.Md5 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
pendingFilesBySha1List = romsHaveSha1
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomSha1Table}] AS t WHERE f.Sha1 = t.Sha1 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
pendingFilesBySha256List = romsHaveSha256
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomSha256Table}] AS t WHERE f.Sha256 = t.Sha256 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
pendingFilesBySha384List = romsHaveSha384
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomSha384Table}] AS t WHERE f.Sha384 = t.Sha384 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
pendingFilesBySha512List = romsHaveSha512
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomSha512Table}] AS t WHERE f.Sha512 = t.Sha512 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
pendingDisksByMd5 = disksHaveMd5
|
||||
? ctx.Disks
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Disks AS f, [{tmpDiskMd5Table}] AS t WHERE f.Md5 = t.Md5")
|
||||
.ToDictionary(f => f.Md5)
|
||||
: [];
|
||||
|
||||
pendingDisksBySha1 = disksHaveSha1
|
||||
? ctx.Disks
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Disks AS f, [{tmpDiskSha1Table}] AS t WHERE f.Sha1 = t.Sha1")
|
||||
.ToDictionary(f => f.Sha1)
|
||||
: [];
|
||||
|
||||
pendingMediasByMd5 = mediasHaveMd5
|
||||
? ctx.Medias
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Medias AS f, [{tmpMediaMd5Table}] AS t WHERE f.Md5 = t.Md5")
|
||||
.ToDictionary(f => f.Md5)
|
||||
: [];
|
||||
|
||||
pendingMediasBySha1 = mediasHaveSha1
|
||||
? ctx.Medias
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Medias AS f, [{tmpMediaSha1Table}] AS t WHERE f.Sha1 = t.Sha1")
|
||||
.ToDictionary(f => f.Sha1)
|
||||
: [];
|
||||
|
||||
pendingMediasBySha256 = mediasHaveSha256
|
||||
? ctx.Medias
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Medias AS f, [{tmpMediaSha256Table}] AS t WHERE f.Sha256 = t.Sha256")
|
||||
.ToDictionary(f => f.Sha256)
|
||||
: [];
|
||||
}
|
||||
|
||||
List<DbFile> pendingFilesByCrcList = romsHaveCrc
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomCrc32Table}] AS t WHERE f.Crc32 = t.Crc32 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
List<DbFile> pendingFilesByMd5List = romsHaveMd5
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomMd5Table}] AS t WHERE f.Md5 = t.Md5 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
List<DbFile> pendingFilesBySha1List =
|
||||
romsHaveSha1
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomSha1Table}] AS t WHERE f.Sha1 = t.Sha1 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
List<DbFile> pendingFilesBySha256List =
|
||||
romsHaveSha256
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomSha256Table}] AS t WHERE f.Sha256 = t.Sha256 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
List<DbFile> pendingFilesBySha384List =
|
||||
romsHaveSha384
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomSha384Table}] AS t WHERE f.Sha384 = t.Sha384 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
List<DbFile> pendingFilesBySha512List =
|
||||
romsHaveSha512
|
||||
? ctx.Files
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Files AS f, [{tmpRomSha512Table}] AS t WHERE f.Sha512 = t.Sha512 AND f.Size = t.Size")
|
||||
.ToList()
|
||||
: [];
|
||||
|
||||
Dictionary<string, DbDisk> pendingDisksByMd5 =
|
||||
disksHaveMd5
|
||||
? ctx.Disks
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Disks AS f, [{tmpDiskMd5Table}] AS t WHERE f.Md5 = t.Md5")
|
||||
.ToDictionary(f => f.Md5)
|
||||
: [];
|
||||
|
||||
Dictionary<string, DbDisk> pendingDisksBySha1 =
|
||||
disksHaveSha1
|
||||
? ctx.Disks
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Disks AS f, [{tmpDiskSha1Table}] AS t WHERE f.Sha1 = t.Sha1")
|
||||
.ToDictionary(f => f.Sha1)
|
||||
: [];
|
||||
|
||||
Dictionary<string, DbMedia> pendingMediasByMd5 =
|
||||
mediasHaveMd5
|
||||
? ctx.Medias
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Medias AS f, [{tmpMediaMd5Table}] AS t WHERE f.Md5 = t.Md5")
|
||||
.ToDictionary(f => f.Md5)
|
||||
: [];
|
||||
|
||||
Dictionary<string, DbMedia> pendingMediasBySha1 =
|
||||
mediasHaveSha1
|
||||
? ctx.Medias
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Medias AS f, [{tmpMediaSha1Table}] AS t WHERE f.Sha1 = t.Sha1")
|
||||
.ToDictionary(f => f.Sha1)
|
||||
: [];
|
||||
|
||||
Dictionary<string, DbMedia> pendingMediasBySha256 =
|
||||
mediasHaveSha256
|
||||
? ctx.Medias
|
||||
.FromSqlRaw($"SELECT DISTINCT f.* FROM Medias AS f, [{tmpMediaSha256Table}] AS t WHERE f.Sha256 = t.Sha256")
|
||||
.ToDictionary(f => f.Sha256)
|
||||
: [];
|
||||
|
||||
var pendingFilesByCrc = new Dictionary<string, DbFile>();
|
||||
var pendingFilesByMd5 = new Dictionary<string, DbFile>();
|
||||
var pendingFilesBySha1 = new Dictionary<string, DbFile>();
|
||||
var pendingFilesBySha256 = new Dictionary<string, DbFile>();
|
||||
var pendingFilesBySha384 = new Dictionary<string, DbFile>();
|
||||
var pendingFilesBySha512 = new Dictionary<string, DbFile>();
|
||||
var pendingFiles = new List<DbFile>();
|
||||
|
||||
// This is because of hash collisions.
|
||||
foreach(DbFile item in pendingFilesByCrcList)
|
||||
{
|
||||
if(pendingFilesByCrc.ContainsKey(item.Crc32))
|
||||
pendingFiles.Add(item);
|
||||
else
|
||||
pendingFilesByCrc[item.Crc32] = item;
|
||||
}
|
||||
var pendingFiles = pendingFilesByCrcList.Where(item => !pendingFilesByCrc.TryAdd(item.Crc32, item))
|
||||
.ToList();
|
||||
|
||||
foreach(DbFile item in pendingFilesByMd5List)
|
||||
{
|
||||
if(pendingFilesByMd5.ContainsKey(item.Md5))
|
||||
pendingFiles.Add(item);
|
||||
else
|
||||
pendingFilesByMd5[item.Md5] = item;
|
||||
}
|
||||
pendingFiles.AddRange(pendingFilesByMd5List.Where(item => !pendingFilesByMd5.TryAdd(item.Md5, item)));
|
||||
pendingFiles.AddRange(pendingFilesBySha1List.Where(item => !pendingFilesBySha1.TryAdd(item.Sha1, item)));
|
||||
|
||||
foreach(DbFile item in pendingFilesBySha1List)
|
||||
{
|
||||
if(pendingFilesBySha1.ContainsKey(item.Sha1))
|
||||
pendingFiles.Add(item);
|
||||
else
|
||||
pendingFilesBySha1[item.Sha1] = item;
|
||||
}
|
||||
pendingFiles.AddRange(pendingFilesBySha256List.Where(item => !pendingFilesBySha256
|
||||
.TryAdd(item.Sha256, item)));
|
||||
|
||||
foreach(DbFile item in pendingFilesBySha256List)
|
||||
{
|
||||
if(pendingFilesBySha256.ContainsKey(item.Sha256))
|
||||
pendingFiles.Add(item);
|
||||
else
|
||||
pendingFilesBySha256[item.Sha256] = item;
|
||||
}
|
||||
pendingFiles.AddRange(pendingFilesBySha384List.Where(item => !pendingFilesBySha384
|
||||
.TryAdd(item.Sha384, item)));
|
||||
|
||||
foreach(DbFile item in pendingFilesBySha384List)
|
||||
{
|
||||
if(pendingFilesBySha384.ContainsKey(item.Sha384))
|
||||
pendingFiles.Add(item);
|
||||
else
|
||||
pendingFilesBySha384[item.Sha384] = item;
|
||||
}
|
||||
|
||||
foreach(DbFile item in pendingFilesBySha512List)
|
||||
{
|
||||
if(pendingFilesBySha512.ContainsKey(item.Sha512))
|
||||
pendingFiles.Add(item);
|
||||
else
|
||||
pendingFilesBySha512[item.Sha512] = item;
|
||||
}
|
||||
pendingFiles.AddRange(pendingFilesBySha512List.Where(item => !pendingFilesBySha512
|
||||
.TryAdd(item.Sha512, item)));
|
||||
|
||||
// Clear some memory
|
||||
pendingFilesByCrcList.Clear();
|
||||
@@ -609,17 +587,20 @@ public sealed class DatImporter
|
||||
pendingFilesBySha384List.Clear();
|
||||
pendingFilesBySha512List.Clear();
|
||||
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomCrc32Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomMd5Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomSha1Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomSha256Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomSha384Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomSha512Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpDiskMd5Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpDiskSha1Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpMediaMd5Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpMediaSha1Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpMediaSha256Table}]");
|
||||
lock(_dbLock)
|
||||
{
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomCrc32Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomMd5Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomSha1Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomSha256Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomSha384Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpRomSha512Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpDiskMd5Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpDiskSha1Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpMediaMd5Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpMediaSha1Table}]");
|
||||
ctx.Database.ExecuteSqlRaw($"DROP TABLE [{tmpMediaSha256Table}]");
|
||||
}
|
||||
|
||||
SetProgressBounds?.Invoke(this,
|
||||
new ProgressBoundsEventArgs
|
||||
@@ -923,7 +904,10 @@ public sealed class DatImporter
|
||||
|
||||
SetIndeterminateProgress?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
ctx.BulkInsert(newFiles, b => b.SetOutputIdentity = true);
|
||||
lock(_dbLock)
|
||||
{
|
||||
ctx.BulkInsert(newFiles, b => b.SetOutputIdentity = true);
|
||||
}
|
||||
|
||||
foreach(FileByMachine fbm in newFilesByMachine)
|
||||
{
|
||||
@@ -931,9 +915,12 @@ public sealed class DatImporter
|
||||
fbm.MachineId = fbm.Machine.Id;
|
||||
}
|
||||
|
||||
ctx.BulkInsert(newFilesByMachine);
|
||||
lock(_dbLock)
|
||||
{
|
||||
ctx.BulkInsert(newFilesByMachine);
|
||||
|
||||
ctx.SaveChanges();
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
||||
pendingFilesBySha512.Clear();
|
||||
pendingFilesBySha384.Clear();
|
||||
@@ -1056,7 +1043,10 @@ public sealed class DatImporter
|
||||
|
||||
SetIndeterminateProgress?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
ctx.BulkInsert(newDisks, b => b.SetOutputIdentity = true);
|
||||
lock(_dbLock)
|
||||
{
|
||||
ctx.BulkInsert(newDisks, b => b.SetOutputIdentity = true);
|
||||
}
|
||||
|
||||
foreach(DiskByMachine dbm in newDisksByMachine)
|
||||
{
|
||||
@@ -1064,9 +1054,12 @@ public sealed class DatImporter
|
||||
dbm.MachineId = dbm.Machine.Id;
|
||||
}
|
||||
|
||||
ctx.BulkInsert(newDisksByMachine);
|
||||
lock(_dbLock)
|
||||
{
|
||||
ctx.BulkInsert(newDisksByMachine);
|
||||
|
||||
ctx.SaveChanges();
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
||||
pendingDisksBySha1.Clear();
|
||||
pendingDisksByMd5.Clear();
|
||||
@@ -1203,7 +1196,10 @@ public sealed class DatImporter
|
||||
|
||||
SetIndeterminateProgress?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
ctx.BulkInsert(newMedias, b => b.SetOutputIdentity = true);
|
||||
lock(_dbLock)
|
||||
{
|
||||
ctx.BulkInsert(newMedias, b => b.SetOutputIdentity = true);
|
||||
}
|
||||
|
||||
foreach(MediaByMachine mbm in newMediasByMachine)
|
||||
{
|
||||
@@ -1211,63 +1207,70 @@ public sealed class DatImporter
|
||||
mbm.MachineId = mbm.Machine.Id;
|
||||
}
|
||||
|
||||
ctx.BulkInsert(newMediasByMachine);
|
||||
lock(_dbLock)
|
||||
{
|
||||
ctx.BulkInsert(newMediasByMachine);
|
||||
|
||||
ctx.SaveChanges();
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
||||
pendingMediasBySha256.Clear();
|
||||
pendingMediasBySha1.Clear();
|
||||
pendingMediasByMd5.Clear();
|
||||
newMedias.Clear();
|
||||
newMediasByMachine.Clear();
|
||||
RomSetStat stats;
|
||||
|
||||
RomSetStat stats = ctx.RomSets.Where(r => r.Id == romSet.Id)
|
||||
.Select(r => new RomSetStat
|
||||
{
|
||||
RomSetId = r.Id,
|
||||
TotalMachines = r.Machines.Count,
|
||||
CompleteMachines =
|
||||
r.Machines.Count(m => m.Files.Count > 0 &&
|
||||
m.Disks.Count == 0 &&
|
||||
m.Files.All(f => f.File.IsInRepo)) +
|
||||
r.Machines.Count(m => m.Disks.Count > 0 &&
|
||||
m.Files.Count == 0 &&
|
||||
m.Disks.All(f => f.Disk.IsInRepo)) +
|
||||
r.Machines.Count(m => m.Files.Count > 0 &&
|
||||
m.Disks.Count > 0 &&
|
||||
m.Files.All(f => f.File.IsInRepo) &&
|
||||
m.Disks.All(f => f.Disk.IsInRepo)),
|
||||
IncompleteMachines =
|
||||
r.Machines.Count(m => m.Files.Count > 0 &&
|
||||
m.Disks.Count == 0 &&
|
||||
m.Files.Any(f => !f.File.IsInRepo)) +
|
||||
r.Machines.Count(m => m.Disks.Count > 0 &&
|
||||
m.Files.Count == 0 &&
|
||||
m.Disks.Any(f => !f.Disk.IsInRepo)) +
|
||||
r.Machines.Count(m => m.Files.Count > 0 &&
|
||||
m.Disks.Count > 0 &&
|
||||
(m.Files.Any(f => !f.File.IsInRepo) ||
|
||||
m.Disks.Any(f => !f.Disk.IsInRepo))),
|
||||
TotalRoms =
|
||||
r.Machines.Sum(m => m.Files.Count) +
|
||||
r.Machines.Sum(m => m.Disks.Count) +
|
||||
r.Machines.Sum(m => m.Medias.Count),
|
||||
HaveRoms = r.Machines.Sum(m => m.Files.Count(f => f.File.IsInRepo)) +
|
||||
r.Machines.Sum(m => m.Disks.Count(f => f.Disk.IsInRepo)) +
|
||||
r.Machines.Sum(m => m.Medias.Count(f => f.Media.IsInRepo)),
|
||||
MissRoms = r.Machines.Sum(m => m.Files.Count(f => !f.File.IsInRepo)) +
|
||||
r.Machines.Sum(m => m.Disks.Count(f => !f.Disk.IsInRepo)) +
|
||||
r.Machines.Sum(m => m.Medias.Count(f => !f.Media.IsInRepo))
|
||||
})
|
||||
.FirstOrDefault();
|
||||
lock(_dbLock)
|
||||
{
|
||||
stats = ctx.RomSets.Where(r => r.Id == romSet.Id)
|
||||
.Select(r => new RomSetStat
|
||||
{
|
||||
RomSetId = r.Id,
|
||||
TotalMachines = r.Machines.Count,
|
||||
CompleteMachines =
|
||||
r.Machines.Count(m => m.Files.Count > 0 &&
|
||||
m.Disks.Count == 0 &&
|
||||
m.Files.All(f => f.File.IsInRepo)) +
|
||||
r.Machines.Count(m => m.Disks.Count > 0 &&
|
||||
m.Files.Count == 0 &&
|
||||
m.Disks.All(f => f.Disk.IsInRepo)) +
|
||||
r.Machines.Count(m => m.Files.Count > 0 &&
|
||||
m.Disks.Count > 0 &&
|
||||
m.Files.All(f => f.File.IsInRepo) &&
|
||||
m.Disks.All(f => f.Disk.IsInRepo)),
|
||||
IncompleteMachines =
|
||||
r.Machines.Count(m => m.Files.Count > 0 &&
|
||||
m.Disks.Count == 0 &&
|
||||
m.Files.Any(f => !f.File.IsInRepo)) +
|
||||
r.Machines.Count(m => m.Disks.Count > 0 &&
|
||||
m.Files.Count == 0 &&
|
||||
m.Disks.Any(f => !f.Disk.IsInRepo)) +
|
||||
r.Machines.Count(m => m.Files.Count > 0 &&
|
||||
m.Disks.Count > 0 &&
|
||||
(m.Files.Any(f => !f.File.IsInRepo) ||
|
||||
m.Disks.Any(f => !f.Disk.IsInRepo))),
|
||||
TotalRoms =
|
||||
r.Machines.Sum(m => m.Files.Count) +
|
||||
r.Machines.Sum(m => m.Disks.Count) +
|
||||
r.Machines.Sum(m => m.Medias.Count),
|
||||
HaveRoms = r.Machines.Sum(m => m.Files.Count(f => f.File.IsInRepo)) +
|
||||
r.Machines.Sum(m => m.Disks.Count(f => f.Disk.IsInRepo)) +
|
||||
r.Machines.Sum(m => m.Medias.Count(f => f.Media.IsInRepo)),
|
||||
MissRoms = r.Machines.Sum(m => m.Files.Count(f => !f.File.IsInRepo)) +
|
||||
r.Machines.Sum(m => m.Disks.Count(f => !f.Disk.IsInRepo)) +
|
||||
r.Machines.Sum(m => m.Medias.Count(f => !f.Media.IsInRepo))
|
||||
})
|
||||
.FirstOrDefault();
|
||||
|
||||
RomSetStat oldStats = ctx.RomSetStats.Find(stats.RomSetId);
|
||||
RomSetStat oldStats = ctx.RomSetStats.Find(stats.RomSetId);
|
||||
|
||||
if(oldStats != null) ctx.Remove(oldStats);
|
||||
if(oldStats != null) ctx.Remove(oldStats);
|
||||
|
||||
ctx.RomSetStats.Add(stats);
|
||||
ctx.RomSetStats.Add(stats);
|
||||
|
||||
ctx.SaveChanges();
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
||||
WorkFinished?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
|
||||
@@ -11,46 +11,32 @@ namespace RomRepoMgr.Database.Resources {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Localization {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
private static System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
private static System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Localization() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RomRepoMgr.Database.Resources.Localization", typeof(Localization).Assembly);
|
||||
if (object.Equals(null, resourceMan)) {
|
||||
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("RomRepoMgr.Database.Resources.Localization", typeof(Localization).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
@@ -59,9 +45,6 @@ namespace RomRepoMgr.Database.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Settings are not initialized!.
|
||||
/// </summary>
|
||||
internal static string Settings_not_initialized {
|
||||
get {
|
||||
return ResourceManager.GetString("Settings_not_initialized", resourceCulture);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<root>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root"
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
|
||||
id="root"
|
||||
xmlns="">
|
||||
<xsd:element name="root" msdata:IsDataSet="true"></xsd:element>
|
||||
</xsd:schema>
|
||||
|
||||
@@ -11,46 +11,32 @@ namespace RomRepoMgr.Settings.Resources {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Localization {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
private static System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
private static System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Localization() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RomRepoMgr.Settings.Resources.Localization", typeof(Localization).Assembly);
|
||||
if (object.Equals(null, resourceMan)) {
|
||||
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("RomRepoMgr.Settings.Resources.Localization", typeof(Localization).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
@@ -59,9 +45,6 @@ namespace RomRepoMgr.Settings.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unhandled exception calling uname: {0}.
|
||||
/// </summary>
|
||||
internal static string Unhandled_exception_uname {
|
||||
get {
|
||||
return ResourceManager.GetString("Unhandled_exception_uname", resourceCulture);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<root>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root"
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
|
||||
id="root"
|
||||
xmlns="">
|
||||
<xsd:element name="root" msdata:IsDataSet="true"></xsd:element>
|
||||
</xsd:schema>
|
||||
|
||||
Reference in New Issue
Block a user