Add Aaruformat validation and media item type (#29)

* Initial `media` and AaruFormat code

* But... why?

* Fix AIF reading

* Fix D2D, Logiqx cleanup

* Minor cleanup

* Final cleanup round
This commit is contained in:
Matt Nadareski
2020-08-27 16:57:22 -07:00
committed by GitHub
parent 3b481de3b9
commit 4d0a3f55eb
51 changed files with 2853 additions and 908 deletions

View File

@@ -629,7 +629,39 @@ namespace RombaSharp.Features
{
Globals.Logger.Verbose($"Checking and adding file '{datItem.Name}'");
if (datItem.ItemType == ItemType.Rom)
if (datItem.ItemType == ItemType.Disk)
{
Disk disk = (Disk)datItem;
hasItems = true;
if (!string.IsNullOrWhiteSpace(disk.MD5))
md5query += $" (\"{disk.MD5}\"),";
if (!string.IsNullOrWhiteSpace(disk.SHA1))
{
sha1query += $" (\"{disk.SHA1}\"),";
if (!string.IsNullOrWhiteSpace(disk.MD5))
md5sha1query += $" (\"{disk.MD5}\", \"{disk.SHA1}\"),";
}
}
else if (datItem.ItemType == ItemType.Media)
{
Media media = (Media)datItem;
hasItems = true;
if (!string.IsNullOrWhiteSpace(media.MD5))
md5query += $" (\"{media.MD5}\"),";
if (!string.IsNullOrWhiteSpace(media.SHA1))
{
sha1query += $" (\"{media.SHA1}\"),";
if (!string.IsNullOrWhiteSpace(media.MD5))
md5sha1query += $" (\"{media.MD5}\", \"{media.SHA1}\"),";
}
}
else if (datItem.ItemType == ItemType.Rom)
{
Rom rom = (Rom)datItem;
hasItems = true;
@@ -651,22 +683,6 @@ namespace RombaSharp.Features
md5sha1query += $" (\"{rom.MD5}\", \"{rom.SHA1}\"),";
}
}
else if (datItem.ItemType == ItemType.Disk)
{
Disk disk = (Disk)datItem;
hasItems = true;
if (!string.IsNullOrWhiteSpace(disk.MD5))
md5query += $" (\"{disk.MD5}\"),";
if (!string.IsNullOrWhiteSpace(disk.SHA1))
{
sha1query += $" (\"{disk.SHA1}\"),";
if (!string.IsNullOrWhiteSpace(disk.MD5))
md5sha1query += $" (\"{disk.MD5}\", \"{disk.SHA1}\"),";
}
}
}
}