diff --git a/Aaru.CommonTypes/Metadata/DeviceReport.cs b/Aaru.CommonTypes/Metadata/DeviceReport.cs index ca4f89dba..0556959f1 100644 --- a/Aaru.CommonTypes/Metadata/DeviceReport.cs +++ b/Aaru.CommonTypes/Metadata/DeviceReport.cs @@ -779,8 +779,8 @@ public class TestedMedia [DisplayName("Can read scrambled DVD sectors using HL-DT-ST cache trick")] public bool? SupportsHLDTSTReadRawDVD { get; set; } - [DisplayName("Can read scrambled DVD sectors using Lite-On cache trick")] - public bool? SupportsLiteOnReadRawDVD { get; set; } + [DisplayName("Can read scrambled DVD sectors using SCSI ReadBuffer 3C")] + public bool? SupportsReadBuffer3CRawDVD { get; set; } [DisplayName("Supports NEC READ CD-DA command")] public bool? SupportsNECReadCDDA { get; set; } @@ -1158,11 +1158,11 @@ public class TestedMedia [DisplayName("Data from HL-DT-ST's scrambled DVD reading trick")] public byte[] HLDTSTReadRawDVDData { get; set; } - [DisplayName("Data from Lite-On's scrambled DVD reading trick")] - public byte[] LiteOnReadRawDVDData { get; set; } + [DisplayName("Data from ReadBuffer 3C scrambled DVD reading")] + public byte[] ReadBuffer3CRawDVDData { get; set; } - [DisplayName("Lite-On ReadBuffer fallback data")] - public virtual List LiteOnReadBufferData { get; set; } + [DisplayName("ReadBuffer 3C fallback data")] + public virtual List ReadBuffer3CReadBufferData { get; set; } #endregion } diff --git a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs index d27c31913..21a7c208c 100644 --- a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs +++ b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs @@ -804,7 +804,7 @@ partial class Dump { mediaTags.TryGetValue(MediaTagType.DVD_DiscKey_Decrypted, out byte[] discKey); - if(scsiReader.HldtstReadRaw || scsiReader.LiteOnReadRaw) + if(scsiReader.HldtstReadRaw || scsiReader.ReadBuffer3CReadRaw) { ReadCacheData(blocks, blocksToRead, @@ -904,7 +904,7 @@ partial class Dump _titleKeys && // Unnecessary since keys are already in raw data - !scsiReader.LiteOnReadRaw && + !scsiReader.ReadBuffer3CReadRaw && !scsiReader.HldtstReadRaw && mediaTag is not null) RetryTitleKeys(dvdDecrypt, mediaTag, ref totalDuration); diff --git a/Aaru.Core/Devices/Dumping/Sbc/Error.cs b/Aaru.Core/Devices/Dumping/Sbc/Error.cs index 51a9c0e10..010bca909 100644 --- a/Aaru.Core/Devices/Dumping/Sbc/Error.cs +++ b/Aaru.Core/Devices/Dumping/Sbc/Error.cs @@ -306,7 +306,7 @@ partial class Dump _resume.BadBlocks.Remove(badSector); extents.Add(badSector); - if(scsiReader.LiteOnReadRaw || scsiReader.HldtstReadRaw) + if(scsiReader.ReadBuffer3CReadRaw || scsiReader.HldtstReadRaw) { var cmi = new byte[1]; diff --git a/Aaru.Core/Devices/Dumping/Sbc/Trim.cs b/Aaru.Core/Devices/Dumping/Sbc/Trim.cs index 94aed2512..fedbf22c1 100644 --- a/Aaru.Core/Devices/Dumping/Sbc/Trim.cs +++ b/Aaru.Core/Devices/Dumping/Sbc/Trim.cs @@ -99,7 +99,7 @@ partial class Dump _resume.BadBlocks.Remove(badSector); extents.Add(badSector); - if(scsiReader.LiteOnReadRaw || scsiReader.HldtstReadRaw) + if(scsiReader.ReadBuffer3CReadRaw || scsiReader.HldtstReadRaw) { var cmi = new byte[1]; diff --git a/Aaru.Core/Devices/ReaderSCSI.cs b/Aaru.Core/Devices/ReaderSCSI.cs index 76a8cbf91..a6f0b8872 100644 --- a/Aaru.Core/Devices/ReaderSCSI.cs +++ b/Aaru.Core/Devices/ReaderSCSI.cs @@ -55,7 +55,7 @@ sealed partial class Reader // TODO: Raw reading public bool HldtstReadRaw; public uint layerbreak; - public bool LiteOnReadRaw; + public bool ReadBuffer3CReadRaw; public bool otp; ulong ScsiGetBlocks() => ScsiGetBlockSize() ? 0 : Blocks; @@ -580,16 +580,14 @@ sealed partial class Reader case "PLEXTOR": _plextorReadRaw = !_dev.PlextorReadRawDvd(out _, out senseBuf, 0, 1, _timeout, out _); - break; - case "LITE-ON": - case "TSSTcorp": - LiteOnReadRaw = - !_dev.LiteOnReadRawDvd(out _, out senseBuf, 0, 1, _timeout, out _, layerbreak, otp); - break; } - if(HldtstReadRaw || _plextorReadRaw || LiteOnReadRaw) + // Try ReadBuffer 3C on all devices + ReadBuffer3CReadRaw = + !_dev.ReadBuffer3CRawDvd(out _, out senseBuf, 0, 1, _timeout, out _, layerbreak, otp); + + if(HldtstReadRaw || _plextorReadRaw || ReadBuffer3CReadRaw) { CanReadRaw = true; LongBlockSize = 2064; @@ -624,8 +622,8 @@ sealed partial class Reader AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_HL_DT_ST_raw_DVD_reading}[/]"); else if(_plextorReadRaw) AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_Plextor_raw_DVD_reading}[/]"); - else if(LiteOnReadRaw) - AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_Lite_On_raw_DVD_reading}[/]"); + else if(ReadBuffer3CReadRaw) + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_ReadBuffer_3C_raw_DVD_reading}[/]"); } else if(_read6) AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_SCSI_READ_6_command}[/]"); @@ -687,7 +685,7 @@ sealed partial class Reader while(true) { - if(HldtstReadRaw || LiteOnReadRaw) + if(HldtstReadRaw || ReadBuffer3CReadRaw) BlocksToRead = 1; else if(_read6) { @@ -835,16 +833,16 @@ sealed partial class Reader _timeout, out duration); } - else if(LiteOnReadRaw) + else if(ReadBuffer3CReadRaw) { - sense = _dev.LiteOnReadRawDvd(out buffer, - out senseBuf, - (uint)block, - count, - _timeout, - out duration, - layerbreak, - otp); + sense = _dev.ReadBuffer3CRawDvd(out buffer, + out senseBuf, + (uint)block, + count, + _timeout, + out duration, + layerbreak, + otp); } else return true; diff --git a/Aaru.Core/Devices/Report/MMC.cs b/Aaru.Core/Devices/Report/MMC.cs index c63ca506e..84cd89a51 100644 --- a/Aaru.Core/Devices/Report/MMC.cs +++ b/Aaru.Core/Devices/Report/MMC.cs @@ -2760,23 +2760,23 @@ public sealed partial class DeviceReport { ctx.AddTask(Localization.Core.Trying_ReadBuffer_3C_trick_to_raw_read_DVDs).IsIndeterminate(); - mediaTest.SupportsLiteOnReadRawDVD = - !_dev.LiteOnReadRawDvd(out buffer, out _, 16, 1, _dev.Timeout, out _, 0xffff, false); + mediaTest.SupportsReadBuffer3CRawDVD = + !_dev.ReadBuffer3CRawDvd(out buffer, out _, 16, 1, _dev.Timeout, out _, 0xffff, false); }); - AaruLogging.Debug(SCSI_MODULE_NAME, Localization.Core.Sense_equals_0, !mediaTest.SupportsLiteOnReadRawDVD); + AaruLogging.Debug(SCSI_MODULE_NAME, Localization.Core.Sense_equals_0, !mediaTest.SupportsReadBuffer3CRawDVD); - if(mediaTest.SupportsLiteOnReadRawDVD == true) - mediaTest.SupportsLiteOnReadRawDVD = !ArrayHelpers.ArrayIsNullOrEmpty(buffer); + if(mediaTest.SupportsReadBuffer3CRawDVD == true) + mediaTest.SupportsReadBuffer3CRawDVD = !ArrayHelpers.ArrayIsNullOrEmpty(buffer); - if(mediaTest.SupportsLiteOnReadRawDVD == true) + if(mediaTest.SupportsReadBuffer3CRawDVD == true) { - mediaTest.LiteOnReadRawDVDData = buffer; + mediaTest.ReadBuffer3CRawDVDData = buffer; } else { // Fallback: try multiple ReadBuffer 3C variants - mediaTest.LiteOnReadBufferData = new List(); + mediaTest.ReadBuffer3CReadBufferData = new List(); // Try variant 3c 00 00 // First fill buffer with Read12 @@ -2792,7 +2792,7 @@ public sealed partial class DeviceReport if(success && !ArrayHelpers.ArrayIsNullOrEmpty(buffer)) { - mediaTest.LiteOnReadBufferData.Add(new CompressedBufferRead + mediaTest.ReadBuffer3CReadBufferData.Add(new CompressedBufferRead { CommandVariant = "3c0000", CompressedData = CompressBuffer(buffer), @@ -2811,7 +2811,7 @@ public sealed partial class DeviceReport if(success && !ArrayHelpers.ArrayIsNullOrEmpty(buffer)) { - mediaTest.LiteOnReadBufferData.Add(new CompressedBufferRead + mediaTest.ReadBuffer3CReadBufferData.Add(new CompressedBufferRead { CommandVariant = "3c0100", CompressedData = CompressBuffer(buffer), @@ -2830,7 +2830,7 @@ public sealed partial class DeviceReport if(success && !ArrayHelpers.ArrayIsNullOrEmpty(buffer)) { - mediaTest.LiteOnReadBufferData.Add(new CompressedBufferRead + mediaTest.ReadBuffer3CReadBufferData.Add(new CompressedBufferRead { CommandVariant = "3c0101", CompressedData = CompressBuffer(buffer), @@ -2849,7 +2849,7 @@ public sealed partial class DeviceReport if(success && !ArrayHelpers.ArrayIsNullOrEmpty(buffer)) { - mediaTest.LiteOnReadBufferData.Add(new CompressedBufferRead + mediaTest.ReadBuffer3CReadBufferData.Add(new CompressedBufferRead { CommandVariant = "3c0102", CompressedData = CompressBuffer(buffer), @@ -2868,7 +2868,7 @@ public sealed partial class DeviceReport if(success && !ArrayHelpers.ArrayIsNullOrEmpty(buffer)) { - mediaTest.LiteOnReadBufferData.Add(new CompressedBufferRead + mediaTest.ReadBuffer3CReadBufferData.Add(new CompressedBufferRead { CommandVariant = "3c0200", CompressedData = CompressBuffer(buffer), diff --git a/Aaru.Database/Context.cs b/Aaru.Database/Context.cs index 236d3e54c..67192e3d6 100644 --- a/Aaru.Database/Context.cs +++ b/Aaru.Database/Context.cs @@ -245,7 +245,7 @@ public sealed class AaruContext : DbContext modelBuilder.Entity("Aaru.CommonTypes.Metadata.CompressedBufferRead", static b => b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", null) - .WithMany("LiteOnReadBufferData") + .WithMany("ReadBuffer3CReadBufferData") .HasForeignKey("TestedMediaId") .OnDelete(DeleteBehavior.Cascade)); diff --git a/Aaru.Database/Migrations/20260111083646_RenameLiteOnToReadBuffer3C.Designer.cs b/Aaru.Database/Migrations/20260111083646_RenameLiteOnToReadBuffer3C.Designer.cs new file mode 100644 index 000000000..508b2033e --- /dev/null +++ b/Aaru.Database/Migrations/20260111083646_RenameLiteOnToReadBuffer3C.Designer.cs @@ -0,0 +1,2975 @@ +// +using System; +using Aaru.Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Aaru.Database.Migrations +{ + [DbContext(typeof(AaruContext))] + [Migration("20260111083646_RenameLiteOnToReadBuffer3C")] + partial class RenameLiteOnToReadBuffer3C + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.0") + .HasAnnotation("Proxies:ChangeTracking", false) + .HasAnnotation("Proxies:CheckEquality", false) + .HasAnnotation("Proxies:LazyLoading", true); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Ata", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Identify") + .HasColumnType("BLOB"); + + b.Property("ReadCapabilitiesId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ReadCapabilitiesId"); + + b.ToTable("Ata"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.BlockDescriptor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("BlockLength") + .HasColumnType("INTEGER"); + + b.Property("Blocks") + .HasColumnType("INTEGER"); + + b.Property("Density") + .HasColumnType("INTEGER"); + + b.Property("ScsiModeId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ScsiModeId"); + + b.ToTable("BlockDescriptor"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Chs", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Cylinders") + .HasColumnType("INTEGER"); + + b.Property("Heads") + .HasColumnType("INTEGER"); + + b.Property("Sectors") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Chs"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.CompressedBufferRead", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CommandVariant") + .HasColumnType("TEXT"); + + b.Property("CompressedData") + .HasColumnType("BLOB"); + + b.Property("TestedMediaId") + .HasColumnType("INTEGER"); + + b.Property("UncompressedSize") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("TestedMediaId"); + + b.ToTable("CompressedBufferRead"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.DensityCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Code") + .HasColumnType("INTEGER"); + + b.Property("SscSupportedMediaId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("SscSupportedMediaId"); + + b.ToTable("DensityCode"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.FireWire", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("Product") + .HasColumnType("TEXT"); + + b.Property("ProductID") + .HasColumnType("INTEGER"); + + b.Property("RemovableMedia") + .HasColumnType("INTEGER"); + + b.Property("VendorID") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("FireWire"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.GdRomSwapDiscCapabilities", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Lba0Data") + .HasColumnType("BLOB"); + + b.Property("Lba0DecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba0Readable") + .HasColumnType("INTEGER"); + + b.Property("Lba0ScrambledData") + .HasColumnType("BLOB"); + + b.Property("Lba0ScrambledDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba0ScrambledReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba0ScrambledSense") + .HasColumnType("BLOB"); + + b.Property("Lba0Sense") + .HasColumnType("BLOB"); + + b.Property("Lba100000AudioData") + .HasColumnType("BLOB"); + + b.Property("Lba100000AudioDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba100000AudioPqData") + .HasColumnType("BLOB"); + + b.Property("Lba100000AudioPqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba100000AudioPqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba100000AudioPqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba100000AudioPqSense") + .HasColumnType("BLOB"); + + b.Property("Lba100000AudioReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba100000AudioReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba100000AudioRwData") + .HasColumnType("BLOB"); + + b.Property("Lba100000AudioRwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba100000AudioRwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba100000AudioRwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba100000AudioRwSense") + .HasColumnType("BLOB"); + + b.Property("Lba100000AudioSense") + .HasColumnType("BLOB"); + + b.Property("Lba100000Data") + .HasColumnType("BLOB"); + + b.Property("Lba100000DecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba100000PqData") + .HasColumnType("BLOB"); + + b.Property("Lba100000PqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba100000PqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba100000PqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba100000PqSense") + .HasColumnType("BLOB"); + + b.Property("Lba100000Readable") + .HasColumnType("INTEGER"); + + b.Property("Lba100000ReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba100000RwData") + .HasColumnType("BLOB"); + + b.Property("Lba100000RwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba100000RwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba100000RwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba100000RwSense") + .HasColumnType("BLOB"); + + b.Property("Lba100000Sense") + .HasColumnType("BLOB"); + + b.Property("Lba400000AudioData") + .HasColumnType("BLOB"); + + b.Property("Lba400000AudioDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba400000AudioPqData") + .HasColumnType("BLOB"); + + b.Property("Lba400000AudioPqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba400000AudioPqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba400000AudioPqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba400000AudioPqSense") + .HasColumnType("BLOB"); + + b.Property("Lba400000AudioReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba400000AudioReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba400000AudioRwData") + .HasColumnType("BLOB"); + + b.Property("Lba400000AudioRwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba400000AudioRwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba400000AudioRwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba400000AudioRwSense") + .HasColumnType("BLOB"); + + b.Property("Lba400000AudioSense") + .HasColumnType("BLOB"); + + b.Property("Lba400000Data") + .HasColumnType("BLOB"); + + b.Property("Lba400000DecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba400000PqData") + .HasColumnType("BLOB"); + + b.Property("Lba400000PqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba400000PqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba400000PqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba400000PqSense") + .HasColumnType("BLOB"); + + b.Property("Lba400000Readable") + .HasColumnType("INTEGER"); + + b.Property("Lba400000ReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba400000RwData") + .HasColumnType("BLOB"); + + b.Property("Lba400000RwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba400000RwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba400000RwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba400000RwSense") + .HasColumnType("BLOB"); + + b.Property("Lba400000Sense") + .HasColumnType("BLOB"); + + b.Property("Lba44990AudioData") + .HasColumnType("BLOB"); + + b.Property("Lba44990AudioDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba44990AudioPqData") + .HasColumnType("BLOB"); + + b.Property("Lba44990AudioPqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba44990AudioPqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba44990AudioPqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba44990AudioPqSense") + .HasColumnType("BLOB"); + + b.Property("Lba44990AudioReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba44990AudioReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba44990AudioRwData") + .HasColumnType("BLOB"); + + b.Property("Lba44990AudioRwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba44990AudioRwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba44990AudioRwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba44990AudioRwSense") + .HasColumnType("BLOB"); + + b.Property("Lba44990AudioSense") + .HasColumnType("BLOB"); + + b.Property("Lba44990Data") + .HasColumnType("BLOB"); + + b.Property("Lba44990DecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba44990PqData") + .HasColumnType("BLOB"); + + b.Property("Lba44990PqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba44990PqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba44990PqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba44990PqSense") + .HasColumnType("BLOB"); + + b.Property("Lba44990Readable") + .HasColumnType("INTEGER"); + + b.Property("Lba44990ReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba44990RwData") + .HasColumnType("BLOB"); + + b.Property("Lba44990RwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba44990RwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba44990RwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba44990RwSense") + .HasColumnType("BLOB"); + + b.Property("Lba44990Sense") + .HasColumnType("BLOB"); + + b.Property("Lba450000AudioData") + .HasColumnType("BLOB"); + + b.Property("Lba450000AudioDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba450000AudioPqData") + .HasColumnType("BLOB"); + + b.Property("Lba450000AudioPqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba450000AudioPqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba450000AudioPqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba450000AudioPqSense") + .HasColumnType("BLOB"); + + b.Property("Lba450000AudioReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba450000AudioReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba450000AudioRwData") + .HasColumnType("BLOB"); + + b.Property("Lba450000AudioRwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba450000AudioRwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba450000AudioRwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba450000AudioRwSense") + .HasColumnType("BLOB"); + + b.Property("Lba450000AudioSense") + .HasColumnType("BLOB"); + + b.Property("Lba450000Data") + .HasColumnType("BLOB"); + + b.Property("Lba450000DecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba450000PqData") + .HasColumnType("BLOB"); + + b.Property("Lba450000PqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba450000PqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba450000PqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba450000PqSense") + .HasColumnType("BLOB"); + + b.Property("Lba450000Readable") + .HasColumnType("INTEGER"); + + b.Property("Lba450000ReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba450000RwData") + .HasColumnType("BLOB"); + + b.Property("Lba450000RwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba450000RwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba450000RwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba450000RwSense") + .HasColumnType("BLOB"); + + b.Property("Lba450000Sense") + .HasColumnType("BLOB"); + + b.Property("Lba45000AudioData") + .HasColumnType("BLOB"); + + b.Property("Lba45000AudioDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba45000AudioPqData") + .HasColumnType("BLOB"); + + b.Property("Lba45000AudioPqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba45000AudioPqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba45000AudioPqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba45000AudioPqSense") + .HasColumnType("BLOB"); + + b.Property("Lba45000AudioReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba45000AudioReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba45000AudioRwData") + .HasColumnType("BLOB"); + + b.Property("Lba45000AudioRwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba45000AudioRwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba45000AudioRwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba45000AudioRwSense") + .HasColumnType("BLOB"); + + b.Property("Lba45000AudioSense") + .HasColumnType("BLOB"); + + b.Property("Lba45000Data") + .HasColumnType("BLOB"); + + b.Property("Lba45000DecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba45000PqData") + .HasColumnType("BLOB"); + + b.Property("Lba45000PqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba45000PqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba45000PqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba45000PqSense") + .HasColumnType("BLOB"); + + b.Property("Lba45000Readable") + .HasColumnType("INTEGER"); + + b.Property("Lba45000ReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba45000RwData") + .HasColumnType("BLOB"); + + b.Property("Lba45000RwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba45000RwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba45000RwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba45000RwSense") + .HasColumnType("BLOB"); + + b.Property("Lba45000Sense") + .HasColumnType("BLOB"); + + b.Property("Lba50000AudioData") + .HasColumnType("BLOB"); + + b.Property("Lba50000AudioDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba50000AudioPqData") + .HasColumnType("BLOB"); + + b.Property("Lba50000AudioPqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba50000AudioPqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba50000AudioPqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba50000AudioPqSense") + .HasColumnType("BLOB"); + + b.Property("Lba50000AudioReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba50000AudioReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba50000AudioRwData") + .HasColumnType("BLOB"); + + b.Property("Lba50000AudioRwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba50000AudioRwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba50000AudioRwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba50000AudioRwSense") + .HasColumnType("BLOB"); + + b.Property("Lba50000AudioSense") + .HasColumnType("BLOB"); + + b.Property("Lba50000Data") + .HasColumnType("BLOB"); + + b.Property("Lba50000DecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba50000PqData") + .HasColumnType("BLOB"); + + b.Property("Lba50000PqDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba50000PqReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba50000PqReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba50000PqSense") + .HasColumnType("BLOB"); + + b.Property("Lba50000Readable") + .HasColumnType("INTEGER"); + + b.Property("Lba50000ReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba50000RwData") + .HasColumnType("BLOB"); + + b.Property("Lba50000RwDecodedSense") + .HasColumnType("TEXT"); + + b.Property("Lba50000RwReadable") + .HasColumnType("INTEGER"); + + b.Property("Lba50000RwReadableCluster") + .HasColumnType("INTEGER"); + + b.Property("Lba50000RwSense") + .HasColumnType("BLOB"); + + b.Property("Lba50000Sense") + .HasColumnType("BLOB"); + + b.Property("MaximumReadablePqInHdArea") + .HasColumnType("BLOB"); + + b.Property("MaximumReadableRwInHdArea") + .HasColumnType("BLOB"); + + b.Property("MaximumReadableSectorInHdArea") + .HasColumnType("INTEGER"); + + b.Property("MinimumReadableSectorInHdArea") + .HasColumnType("INTEGER"); + + b.Property("RecognizedSwapDisc") + .HasColumnType("INTEGER"); + + b.Property("SwapDiscLeadOutPFRAM") + .HasColumnType("INTEGER"); + + b.Property("SwapDiscLeadOutPMIN") + .HasColumnType("INTEGER"); + + b.Property("SwapDiscLeadOutPSEC") + .HasColumnType("INTEGER"); + + b.Property("SwapDiscLeadOutStart") + .HasColumnType("INTEGER"); + + b.Property("TestCrashed") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("GdRomSwapDiscCapabilities"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Mmc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("FeaturesId") + .HasColumnType("INTEGER"); + + b.Property("ModeSense2AData") + .HasColumnType("BLOB"); + + b.HasKey("Id"); + + b.HasIndex("FeaturesId"); + + b.ToTable("Mmc"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.MmcFeatures", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AACSVersion") + .HasColumnType("INTEGER"); + + b.Property("AGIDs") + .HasColumnType("INTEGER"); + + b.Property("BinaryData") + .HasColumnType("BLOB"); + + b.Property("BindingNonceBlocks") + .HasColumnType("INTEGER"); + + b.Property("BlocksPerReadableUnit") + .HasColumnType("INTEGER"); + + b.Property("BufferUnderrunFreeInDVD") + .HasColumnType("INTEGER"); + + b.Property("BufferUnderrunFreeInSAO") + .HasColumnType("INTEGER"); + + b.Property("BufferUnderrunFreeInTAO") + .HasColumnType("INTEGER"); + + b.Property("CPRMVersion") + .HasColumnType("INTEGER"); + + b.Property("CSSVersion") + .HasColumnType("INTEGER"); + + b.Property("CanAudioScan") + .HasColumnType("INTEGER"); + + b.Property("CanEject") + .HasColumnType("INTEGER"); + + b.Property("CanEraseSector") + .HasColumnType("INTEGER"); + + b.Property("CanExpandBDRESpareArea") + .HasColumnType("INTEGER"); + + b.Property("CanFormat") + .HasColumnType("INTEGER"); + + b.Property("CanFormatBDREWithoutSpare") + .HasColumnType("INTEGER"); + + b.Property("CanFormatCert") + .HasColumnType("INTEGER"); + + b.Property("CanFormatFRF") + .HasColumnType("INTEGER"); + + b.Property("CanFormatQCert") + .HasColumnType("INTEGER"); + + b.Property("CanFormatRRM") + .HasColumnType("INTEGER"); + + b.Property("CanGenerateBindingNonce") + .HasColumnType("INTEGER"); + + b.Property("CanLoad") + .HasColumnType("INTEGER"); + + b.Property("CanMuteSeparateChannels") + .HasColumnType("INTEGER"); + + b.Property("CanOverwriteSAOTrack") + .HasColumnType("INTEGER"); + + b.Property("CanOverwriteTAOTrack") + .HasColumnType("INTEGER"); + + b.Property("CanPlayCDAudio") + .HasColumnType("INTEGER"); + + b.Property("CanPseudoOverwriteBDR") + .HasColumnType("INTEGER"); + + b.Property("CanReadAllDualR") + .HasColumnType("INTEGER"); + + b.Property("CanReadAllDualRW") + .HasColumnType("INTEGER"); + + b.Property("CanReadBD") + .HasColumnType("INTEGER"); + + b.Property("CanReadBDR") + .HasColumnType("INTEGER"); + + b.Property("CanReadBDRE1") + .HasColumnType("INTEGER"); + + b.Property("CanReadBDRE2") + .HasColumnType("INTEGER"); + + b.Property("CanReadBDROM") + .HasColumnType("INTEGER"); + + b.Property("CanReadBluBCA") + .HasColumnType("INTEGER"); + + b.Property("CanReadCD") + .HasColumnType("INTEGER"); + + b.Property("CanReadCDMRW") + .HasColumnType("INTEGER"); + + b.Property("CanReadCPRM_MKB") + .HasColumnType("INTEGER"); + + b.Property("CanReadDDCD") + .HasColumnType("INTEGER"); + + b.Property("CanReadDVD") + .HasColumnType("INTEGER"); + + b.Property("CanReadDVDPlusMRW") + .HasColumnType("INTEGER"); + + b.Property("CanReadDVDPlusR") + .HasColumnType("INTEGER"); + + b.Property("CanReadDVDPlusRDL") + .HasColumnType("INTEGER"); + + b.Property("CanReadDVDPlusRW") + .HasColumnType("INTEGER"); + + b.Property("CanReadDVDPlusRWDL") + .HasColumnType("INTEGER"); + + b.Property("CanReadDriveAACSCertificate") + .HasColumnType("INTEGER"); + + b.Property("CanReadHDDVD") + .HasColumnType("INTEGER"); + + b.Property("CanReadHDDVDR") + .HasColumnType("INTEGER"); + + b.Property("CanReadHDDVDRAM") + .HasColumnType("INTEGER"); + + b.Property("CanReadLeadInCDText") + .HasColumnType("INTEGER"); + + b.Property("CanReadOldBDR") + .HasColumnType("INTEGER"); + + b.Property("CanReadOldBDRE") + .HasColumnType("INTEGER"); + + b.Property("CanReadOldBDROM") + .HasColumnType("INTEGER"); + + b.Property("CanReadSpareAreaInformation") + .HasColumnType("INTEGER"); + + b.Property("CanReportDriveSerial") + .HasColumnType("INTEGER"); + + b.Property("CanReportMediaSerial") + .HasColumnType("INTEGER"); + + b.Property("CanTestWriteDDCDR") + .HasColumnType("INTEGER"); + + b.Property("CanTestWriteDVD") + .HasColumnType("INTEGER"); + + b.Property("CanTestWriteInSAO") + .HasColumnType("INTEGER"); + + b.Property("CanTestWriteInTAO") + .HasColumnType("INTEGER"); + + b.Property("CanUpgradeFirmware") + .HasColumnType("INTEGER"); + + b.Property("CanWriteBD") + .HasColumnType("INTEGER"); + + b.Property("CanWriteBDR") + .HasColumnType("INTEGER"); + + b.Property("CanWriteBDRE1") + .HasColumnType("INTEGER"); + + b.Property("CanWriteBDRE2") + .HasColumnType("INTEGER"); + + b.Property("CanWriteBusEncryptedBlocks") + .HasColumnType("INTEGER"); + + b.Property("CanWriteCDMRW") + .HasColumnType("INTEGER"); + + b.Property("CanWriteCDRW") + .HasColumnType("INTEGER"); + + b.Property("CanWriteCDRWCAV") + .HasColumnType("INTEGER"); + + b.Property("CanWriteCDSAO") + .HasColumnType("INTEGER"); + + b.Property("CanWriteCDTAO") + .HasColumnType("INTEGER"); + + b.Property("CanWriteCSSManagedDVD") + .HasColumnType("INTEGER"); + + b.Property("CanWriteDDCDR") + .HasColumnType("INTEGER"); + + b.Property("CanWriteDDCDRW") + .HasColumnType("INTEGER"); + + b.Property("CanWriteDVDPlusMRW") + .HasColumnType("INTEGER"); + + b.Property("CanWriteDVDPlusR") + .HasColumnType("INTEGER"); + + b.Property("CanWriteDVDPlusRDL") + .HasColumnType("INTEGER"); + + b.Property("CanWriteDVDPlusRW") + .HasColumnType("INTEGER"); + + b.Property("CanWriteDVDPlusRWDL") + .HasColumnType("INTEGER"); + + b.Property("CanWriteDVDR") + .HasColumnType("INTEGER"); + + b.Property("CanWriteDVDRDL") + .HasColumnType("INTEGER"); + + b.Property("CanWriteDVDRW") + .HasColumnType("INTEGER"); + + b.Property("CanWriteHDDVDR") + .HasColumnType("INTEGER"); + + b.Property("CanWriteHDDVDRAM") + .HasColumnType("INTEGER"); + + b.Property("CanWriteOldBDR") + .HasColumnType("INTEGER"); + + b.Property("CanWriteOldBDRE") + .HasColumnType("INTEGER"); + + b.Property("CanWritePackedSubchannelInTAO") + .HasColumnType("INTEGER"); + + b.Property("CanWriteRWSubchannelInSAO") + .HasColumnType("INTEGER"); + + b.Property("CanWriteRWSubchannelInTAO") + .HasColumnType("INTEGER"); + + b.Property("CanWriteRaw") + .HasColumnType("INTEGER"); + + b.Property("CanWriteRawMultiSession") + .HasColumnType("INTEGER"); + + b.Property("CanWriteRawSubchannelInTAO") + .HasColumnType("INTEGER"); + + b.Property("ChangerIsSideChangeCapable") + .HasColumnType("INTEGER"); + + b.Property("ChangerSlots") + .HasColumnType("INTEGER"); + + b.Property("ChangerSupportsDiscPresent") + .HasColumnType("INTEGER"); + + b.Property("DBML") + .HasColumnType("INTEGER"); + + b.Property("DVDMultiRead") + .HasColumnType("INTEGER"); + + b.Property("EmbeddedChanger") + .HasColumnType("INTEGER"); + + b.Property("ErrorRecoveryPage") + .HasColumnType("INTEGER"); + + b.Property("FirmwareDate") + .HasColumnType("TEXT"); + + b.Property("LoadingMechanismType") + .HasColumnType("INTEGER"); + + b.Property("Locked") + .HasColumnType("INTEGER"); + + b.Property("LogicalBlockSize") + .HasColumnType("INTEGER"); + + b.Property("MultiRead") + .HasColumnType("INTEGER"); + + b.Property("PhysicalInterfaceStandardNumber") + .HasColumnType("INTEGER"); + + b.Property("PreventJumper") + .HasColumnType("INTEGER"); + + b.Property("SupportsAACS") + .HasColumnType("INTEGER"); + + b.Property("SupportsBusEncryption") + .HasColumnType("INTEGER"); + + b.Property("SupportsC2") + .HasColumnType("INTEGER"); + + b.Property("SupportsCPRM") + .HasColumnType("INTEGER"); + + b.Property("SupportsCSS") + .HasColumnType("INTEGER"); + + b.Property("SupportsDAP") + .HasColumnType("INTEGER"); + + b.Property("SupportsDeviceBusyEvent") + .HasColumnType("INTEGER"); + + b.Property("SupportsHybridDiscs") + .HasColumnType("INTEGER"); + + b.Property("SupportsModePage1Ch") + .HasColumnType("INTEGER"); + + b.Property("SupportsOSSC") + .HasColumnType("INTEGER"); + + b.Property("SupportsPWP") + .HasColumnType("INTEGER"); + + b.Property("SupportsSWPP") + .HasColumnType("INTEGER"); + + b.Property("SupportsSecurDisc") + .HasColumnType("INTEGER"); + + b.Property("SupportsSeparateVolume") + .HasColumnType("INTEGER"); + + b.Property("SupportsVCPS") + .HasColumnType("INTEGER"); + + b.Property("SupportsWriteInhibitDCB") + .HasColumnType("INTEGER"); + + b.Property("SupportsWriteProtectPAC") + .HasColumnType("INTEGER"); + + b.Property("VolumeLevels") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("MmcFeatures"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.MmcSd", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CID") + .HasColumnType("BLOB"); + + b.Property("CSD") + .HasColumnType("BLOB"); + + b.Property("ExtendedCSD") + .HasColumnType("BLOB"); + + b.Property("OCR") + .HasColumnType("BLOB"); + + b.Property("SCR") + .HasColumnType("BLOB"); + + b.HasKey("Id"); + + b.ToTable("MmcSd"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Pcmcia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CIS") + .HasColumnType("BLOB"); + + b.Property("CardCode") + .HasColumnType("INTEGER"); + + b.Property("Compliance") + .HasColumnType("TEXT"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("ManufacturerCode") + .HasColumnType("INTEGER"); + + b.Property("ProductName") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Pcmcia"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Scsi", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("InquiryData") + .HasColumnType("BLOB"); + + b.Property("ModeSense10ChangeableData") + .HasColumnType("BLOB"); + + b.Property("ModeSense10CurrentData") + .HasColumnType("BLOB"); + + b.Property("ModeSense10Data") + .HasColumnType("BLOB"); + + b.Property("ModeSense6ChangeableData") + .HasColumnType("BLOB"); + + b.Property("ModeSense6CurrentData") + .HasColumnType("BLOB"); + + b.Property("ModeSense6Data") + .HasColumnType("BLOB"); + + b.Property("ModeSenseId") + .HasColumnType("INTEGER"); + + b.Property("MultiMediaDeviceId") + .HasColumnType("INTEGER"); + + b.Property("ReadCapabilitiesId") + .HasColumnType("INTEGER"); + + b.Property("SequentialDeviceId") + .HasColumnType("INTEGER"); + + b.Property("SupportsModeSense10") + .HasColumnType("INTEGER"); + + b.Property("SupportsModeSense6") + .HasColumnType("INTEGER"); + + b.Property("SupportsModeSubpages") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ModeSenseId"); + + b.HasIndex("MultiMediaDeviceId"); + + b.HasIndex("ReadCapabilitiesId"); + + b.HasIndex("SequentialDeviceId"); + + b.ToTable("Scsi"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.ScsiMode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("BlankCheckEnabled") + .HasColumnType("INTEGER"); + + b.Property("BufferedMode") + .HasColumnType("INTEGER"); + + b.Property("DPOandFUA") + .HasColumnType("INTEGER"); + + b.Property("MediumType") + .HasColumnType("INTEGER"); + + b.Property("Speed") + .HasColumnType("INTEGER"); + + b.Property("WriteProtected") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("ScsiMode"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.ScsiPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ScsiId") + .HasColumnType("INTEGER"); + + b.Property("ScsiModeId") + .HasColumnType("INTEGER"); + + b.Property("page") + .HasColumnType("INTEGER"); + + b.Property("subpage") + .HasColumnType("INTEGER"); + + b.Property("value") + .HasColumnType("BLOB"); + + b.HasKey("Id"); + + b.HasIndex("ScsiId"); + + b.HasIndex("ScsiModeId"); + + b.ToTable("ScsiPage"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Ssc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("BlockSizeGranularity") + .HasColumnType("INTEGER"); + + b.Property("MaxBlockLength") + .HasColumnType("INTEGER"); + + b.Property("MinBlockLength") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Ssc"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.SscSupportedMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Length") + .HasColumnType("INTEGER"); + + b.Property("MediumType") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Organization") + .HasColumnType("TEXT"); + + b.Property("SscId") + .HasColumnType("INTEGER"); + + b.Property("TestedSequentialMediaId") + .HasColumnType("INTEGER"); + + b.Property("Width") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("SscId"); + + b.HasIndex("TestedSequentialMediaId"); + + b.ToTable("SscSupportedMedia"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.SupportedDensity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("BitsPerMm") + .HasColumnType("INTEGER"); + + b.Property("Capacity") + .HasColumnType("INTEGER"); + + b.Property("DefaultDensity") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Duplicate") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Organization") + .HasColumnType("TEXT"); + + b.Property("PrimaryCode") + .HasColumnType("INTEGER"); + + b.Property("SecondaryCode") + .HasColumnType("INTEGER"); + + b.Property("SscId") + .HasColumnType("INTEGER"); + + b.Property("TestedSequentialMediaId") + .HasColumnType("INTEGER"); + + b.Property("Tracks") + .HasColumnType("INTEGER"); + + b.Property("Width") + .HasColumnType("INTEGER"); + + b.Property("Writable") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("SscId"); + + b.HasIndex("TestedSequentialMediaId"); + + b.ToTable("SupportedDensity"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AdipData") + .HasColumnType("BLOB"); + + b.Property("AtaId") + .HasColumnType("INTEGER"); + + b.Property("AtipData") + .HasColumnType("BLOB"); + + b.Property("BlockSize") + .HasColumnType("INTEGER"); + + b.Property("Blocks") + .HasColumnType("INTEGER"); + + b.Property("BluBcaData") + .HasColumnType("BLOB"); + + b.Property("BluDdsData") + .HasColumnType("BLOB"); + + b.Property("BluDiData") + .HasColumnType("BLOB"); + + b.Property("BluPacData") + .HasColumnType("BLOB"); + + b.Property("BluSaiData") + .HasColumnType("BLOB"); + + b.Property("C2PointersData") + .HasColumnType("BLOB"); + + b.Property("CHSId") + .HasColumnType("INTEGER"); + + b.Property("CanReadAACS") + .HasColumnType("INTEGER"); + + b.Property("CanReadADIP") + .HasColumnType("INTEGER"); + + b.Property("CanReadATIP") + .HasColumnType("INTEGER"); + + b.Property("CanReadBCA") + .HasColumnType("INTEGER"); + + b.Property("CanReadC2Pointers") + .HasColumnType("INTEGER"); + + b.Property("CanReadCMI") + .HasColumnType("INTEGER"); + + b.Property("CanReadCdScrambled") + .HasColumnType("INTEGER"); + + b.Property("CanReadCorrectedSubchannel") + .HasColumnType("INTEGER"); + + b.Property("CanReadCorrectedSubchannelWithC2") + .HasColumnType("INTEGER"); + + b.Property("CanReadDCB") + .HasColumnType("INTEGER"); + + b.Property("CanReadDDS") + .HasColumnType("INTEGER"); + + b.Property("CanReadDMI") + .HasColumnType("INTEGER"); + + b.Property("CanReadDiscInformation") + .HasColumnType("INTEGER"); + + b.Property("CanReadF1_06") + .HasColumnType("INTEGER"); + + b.Property("CanReadF1_06LeadOut") + .HasColumnType("INTEGER"); + + b.Property("CanReadFirstTrackPreGap") + .HasColumnType("INTEGER"); + + b.Property("CanReadFullTOC") + .HasColumnType("INTEGER"); + + b.Property("CanReadHDCMI") + .HasColumnType("INTEGER"); + + b.Property("CanReadLayerCapacity") + .HasColumnType("INTEGER"); + + b.Property("CanReadLeadIn") + .HasColumnType("INTEGER"); + + b.Property("CanReadLeadOut") + .HasColumnType("INTEGER"); + + b.Property("CanReadMediaID") + .HasColumnType("INTEGER"); + + b.Property("CanReadMediaSerial") + .HasColumnType("INTEGER"); + + b.Property("CanReadPAC") + .HasColumnType("INTEGER"); + + b.Property("CanReadPFI") + .HasColumnType("INTEGER"); + + b.Property("CanReadPMA") + .HasColumnType("INTEGER"); + + b.Property("CanReadPQSubchannel") + .HasColumnType("INTEGER"); + + b.Property("CanReadPQSubchannelWithC2") + .HasColumnType("INTEGER"); + + b.Property("CanReadPRI") + .HasColumnType("INTEGER"); + + b.Property("CanReadRWSubchannel") + .HasColumnType("INTEGER"); + + b.Property("CanReadRWSubchannelWithC2") + .HasColumnType("INTEGER"); + + b.Property("CanReadRecordablePFI") + .HasColumnType("INTEGER"); + + b.Property("CanReadSpareAreaInformation") + .HasColumnType("INTEGER"); + + b.Property("CanReadTOC") + .HasColumnType("INTEGER"); + + b.Property("CanReadingIntersessionLeadIn") + .HasColumnType("INTEGER"); + + b.Property("CanReadingIntersessionLeadOut") + .HasColumnType("INTEGER"); + + b.Property("CmiData") + .HasColumnType("BLOB"); + + b.Property("CorrectedSubchannelData") + .HasColumnType("BLOB"); + + b.Property("CorrectedSubchannelWithC2Data") + .HasColumnType("BLOB"); + + b.Property("CurrentCHSId") + .HasColumnType("INTEGER"); + + b.Property("DcbData") + .HasColumnType("BLOB"); + + b.Property("Density") + .HasColumnType("INTEGER"); + + b.Property("DmiData") + .HasColumnType("BLOB"); + + b.Property("DvdAacsData") + .HasColumnType("BLOB"); + + b.Property("DvdBcaData") + .HasColumnType("BLOB"); + + b.Property("DvdDdsData") + .HasColumnType("BLOB"); + + b.Property("DvdLayerData") + .HasColumnType("BLOB"); + + b.Property("DvdSaiData") + .HasColumnType("BLOB"); + + b.Property("EmbossedPfiData") + .HasColumnType("BLOB"); + + b.Property("FullTocData") + .HasColumnType("BLOB"); + + b.Property("HLDTSTReadRawDVDData") + .HasColumnType("BLOB"); + + b.Property("HdCmiData") + .HasColumnType("BLOB"); + + b.Property("IdentifyData") + .HasColumnType("BLOB"); + + b.Property("IntersessionLeadInData") + .HasColumnType("BLOB"); + + b.Property("IntersessionLeadOutData") + .HasColumnType("BLOB"); + + b.Property("LBA48Sectors") + .HasColumnType("INTEGER"); + + b.Property("LBASectors") + .HasColumnType("INTEGER"); + + b.Property("LeadInData") + .HasColumnType("BLOB"); + + b.Property("LeadOutData") + .HasColumnType("BLOB"); + + b.Property("LogicalAlignment") + .HasColumnType("INTEGER"); + + b.Property("LongBlockSize") + .HasColumnType("INTEGER"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("MediaIsRecognized") + .HasColumnType("INTEGER"); + + b.Property("MediumType") + .HasColumnType("INTEGER"); + + b.Property("MediumTypeName") + .HasColumnType("TEXT"); + + b.Property("MmcId") + .HasColumnType("INTEGER"); + + b.Property("ModeSense10Data") + .HasColumnType("BLOB"); + + b.Property("ModeSense6Data") + .HasColumnType("BLOB"); + + b.Property("Model") + .HasColumnType("TEXT"); + + b.Property("NecReadCddaData") + .HasColumnType("BLOB"); + + b.Property("NominalRotationRate") + .HasColumnType("INTEGER"); + + b.Property("PQSubchannelData") + .HasColumnType("BLOB"); + + b.Property("PQSubchannelWithC2Data") + .HasColumnType("BLOB"); + + b.Property("PfiData") + .HasColumnType("BLOB"); + + b.Property("PhysicalBlockSize") + .HasColumnType("INTEGER"); + + b.Property("PioneerReadCddaData") + .HasColumnType("BLOB"); + + b.Property("PioneerReadCddaMsfData") + .HasColumnType("BLOB"); + + b.Property("PlextorReadCddaData") + .HasColumnType("BLOB"); + + b.Property("PlextorReadRawDVDData") + .HasColumnType("BLOB"); + + b.Property("PmaData") + .HasColumnType("BLOB"); + + b.Property("PriData") + .HasColumnType("BLOB"); + + b.Property("RWSubchannelData") + .HasColumnType("BLOB"); + + b.Property("RWSubchannelWithC2Data") + .HasColumnType("BLOB"); + + b.Property("Read10Data") + .HasColumnType("BLOB"); + + b.Property("Read12Data") + .HasColumnType("BLOB"); + + b.Property("Read16Data") + .HasColumnType("BLOB"); + + b.Property("Read6Data") + .HasColumnType("BLOB"); + + b.Property("ReadBuffer3CRawDVDData") + .HasColumnType("BLOB"); + + b.Property("ReadCdData") + .HasColumnType("BLOB"); + + b.Property("ReadCdFullData") + .HasColumnType("BLOB"); + + b.Property("ReadCdMsfData") + .HasColumnType("BLOB"); + + b.Property("ReadCdMsfFullData") + .HasColumnType("BLOB"); + + b.Property("ReadCdScrambledData") + .HasColumnType("BLOB"); + + b.Property("ReadDmaData") + .HasColumnType("BLOB"); + + b.Property("ReadDmaLba48Data") + .HasColumnType("BLOB"); + + b.Property("ReadDmaLbaData") + .HasColumnType("BLOB"); + + b.Property("ReadDmaRetryData") + .HasColumnType("BLOB"); + + b.Property("ReadDmaRetryLbaData") + .HasColumnType("BLOB"); + + b.Property("ReadF1_06Data") + .HasColumnType("BLOB"); + + b.Property("ReadF1_06LeadOutData") + .HasColumnType("BLOB"); + + b.Property("ReadLba48Data") + .HasColumnType("BLOB"); + + b.Property("ReadLbaData") + .HasColumnType("BLOB"); + + b.Property("ReadLong10Data") + .HasColumnType("BLOB"); + + b.Property("ReadLong16Data") + .HasColumnType("BLOB"); + + b.Property("ReadLongData") + .HasColumnType("BLOB"); + + b.Property("ReadLongLbaData") + .HasColumnType("BLOB"); + + b.Property("ReadLongRetryData") + .HasColumnType("BLOB"); + + b.Property("ReadLongRetryLbaData") + .HasColumnType("BLOB"); + + b.Property("ReadRetryLbaData") + .HasColumnType("BLOB"); + + b.Property("ReadSectorsData") + .HasColumnType("BLOB"); + + b.Property("ReadSectorsRetryData") + .HasColumnType("BLOB"); + + b.Property("ScsiId") + .HasColumnType("INTEGER"); + + b.Property("SolidStateDevice") + .HasColumnType("INTEGER"); + + b.Property("SupportsHLDTSTReadRawDVD") + .HasColumnType("INTEGER"); + + b.Property("SupportsNECReadCDDA") + .HasColumnType("INTEGER"); + + b.Property("SupportsPioneerReadCDDA") + .HasColumnType("INTEGER"); + + b.Property("SupportsPioneerReadCDDAMSF") + .HasColumnType("INTEGER"); + + b.Property("SupportsPlextorReadCDDA") + .HasColumnType("INTEGER"); + + b.Property("SupportsPlextorReadRawDVD") + .HasColumnType("INTEGER"); + + b.Property("SupportsRead10") + .HasColumnType("INTEGER"); + + b.Property("SupportsRead12") + .HasColumnType("INTEGER"); + + b.Property("SupportsRead16") + .HasColumnType("INTEGER"); + + b.Property("SupportsRead6") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadBuffer3CRawDVD") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadCapacity") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadCapacity16") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadCd") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadCdMsf") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadCdMsfRaw") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadCdRaw") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadDma") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadDmaLba") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadDmaLba48") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadDmaRetry") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadDmaRetryLba") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadLba") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadLba48") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadLong") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadLong16") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadLongLba") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadLongRetry") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadLongRetryLba") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadRetry") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadRetryLba") + .HasColumnType("INTEGER"); + + b.Property("SupportsReadSectors") + .HasColumnType("INTEGER"); + + b.Property("SupportsSeek") + .HasColumnType("INTEGER"); + + b.Property("SupportsSeekLba") + .HasColumnType("INTEGER"); + + b.Property("TocData") + .HasColumnType("BLOB"); + + b.Property("Track1PregapData") + .HasColumnType("BLOB"); + + b.Property("UnformattedBPS") + .HasColumnType("INTEGER"); + + b.Property("UnformattedBPT") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("AtaId"); + + b.HasIndex("CHSId"); + + b.HasIndex("CurrentCHSId"); + + b.HasIndex("MmcId"); + + b.HasIndex("ScsiId"); + + b.ToTable("TestedMedia"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedSequentialMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CanReadMediaSerial") + .HasColumnType("INTEGER"); + + b.Property("Density") + .HasColumnType("INTEGER"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("MediaIsRecognized") + .HasColumnType("INTEGER"); + + b.Property("MediumType") + .HasColumnType("INTEGER"); + + b.Property("MediumTypeName") + .HasColumnType("TEXT"); + + b.Property("ModeSense10Data") + .HasColumnType("BLOB"); + + b.Property("ModeSense6Data") + .HasColumnType("BLOB"); + + b.Property("Model") + .HasColumnType("TEXT"); + + b.Property("SscId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("SscId"); + + b.ToTable("TestedSequentialMedia"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Usb", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Descriptors") + .HasColumnType("BLOB"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("Product") + .HasColumnType("TEXT"); + + b.Property("ProductID") + .HasColumnType("INTEGER"); + + b.Property("RemovableMedia") + .HasColumnType("INTEGER"); + + b.Property("VendorID") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Usb"); + }); + + modelBuilder.Entity("Aaru.Database.Models.Archive", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Archives"); + }); + + modelBuilder.Entity("Aaru.Database.Models.CdOffset", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AddedWhen") + .HasColumnType("TEXT"); + + b.Property("Agreement") + .HasColumnType("REAL"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("Model") + .HasColumnType("TEXT"); + + b.Property("ModifiedWhen") + .HasColumnType("TEXT"); + + b.Property("Offset") + .HasColumnType("INTEGER"); + + b.Property("Submissions") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ModifiedWhen"); + + b.ToTable("CdOffsets"); + }); + + modelBuilder.Entity("Aaru.Database.Models.Command", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Commands"); + }); + + modelBuilder.Entity("Aaru.Database.Models.Device", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ATAId") + .HasColumnType("INTEGER"); + + b.Property("ATAPIId") + .HasColumnType("INTEGER"); + + b.Property("CanReadGdRomUsingSwapDisc") + .HasColumnType("INTEGER"); + + b.Property("CompactFlash") + .HasColumnType("INTEGER"); + + b.Property("FireWireId") + .HasColumnType("INTEGER"); + + b.Property("GdRomSwapDiscCapabilitiesId") + .HasColumnType("INTEGER"); + + b.Property("LastSynchronized") + .HasColumnType("TEXT"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("Model") + .HasColumnType("TEXT"); + + b.Property("MultiMediaCardId") + .HasColumnType("INTEGER"); + + b.Property("OptimalMultipleSectorsRead") + .HasColumnType("INTEGER"); + + b.Property("PCMCIAId") + .HasColumnType("INTEGER"); + + b.Property("Revision") + .HasColumnType("TEXT"); + + b.Property("SCSIId") + .HasColumnType("INTEGER"); + + b.Property("SecureDigitalId") + .HasColumnType("INTEGER"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("USBId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ATAId"); + + b.HasIndex("ATAPIId"); + + b.HasIndex("FireWireId"); + + b.HasIndex("GdRomSwapDiscCapabilitiesId"); + + b.HasIndex("MultiMediaCardId"); + + b.HasIndex("PCMCIAId"); + + b.HasIndex("SCSIId"); + + b.HasIndex("SecureDigitalId"); + + b.HasIndex("USBId"); + + b.ToTable("Devices"); + }); + + modelBuilder.Entity("Aaru.Database.Models.DeviceStat", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Bus") + .HasColumnType("TEXT"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("Model") + .HasColumnType("TEXT"); + + b.Property("Revision") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("SeenDevices"); + }); + + modelBuilder.Entity("Aaru.Database.Models.Filesystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Filesystems"); + }); + + modelBuilder.Entity("Aaru.Database.Models.Filter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Filters"); + }); + + modelBuilder.Entity("Aaru.Database.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Real") + .HasColumnType("INTEGER"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.Property("Type") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Medias"); + }); + + modelBuilder.Entity("Aaru.Database.Models.MediaFormat", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("MediaFormats"); + }); + + modelBuilder.Entity("Aaru.Database.Models.NesHeaderInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AddedWhen") + .HasColumnType("TEXT"); + + b.Property("BatteryPresent") + .HasColumnType("INTEGER"); + + b.Property("ConsoleType") + .HasColumnType("INTEGER"); + + b.Property("DefaultExpansionDevice") + .HasColumnType("INTEGER"); + + b.Property("ExtendedConsoleType") + .HasColumnType("INTEGER"); + + b.Property("FourScreenMode") + .HasColumnType("INTEGER"); + + b.Property("Mapper") + .HasColumnType("INTEGER"); + + b.Property("ModifiedWhen") + .HasColumnType("TEXT"); + + b.Property("NametableMirroring") + .HasColumnType("INTEGER"); + + b.Property("Sha256") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("TEXT"); + + b.Property("Submapper") + .HasColumnType("INTEGER"); + + b.Property("TimingMode") + .HasColumnType("INTEGER"); + + b.Property("VsHardwareType") + .HasColumnType("INTEGER"); + + b.Property("VsPpuType") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ModifiedWhen"); + + b.HasIndex("Sha256"); + + b.ToTable("NesHeaders"); + }); + + modelBuilder.Entity("Aaru.Database.Models.OperatingSystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.Property("Version") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("OperatingSystems"); + }); + + modelBuilder.Entity("Aaru.Database.Models.Partition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Partitions"); + }); + + modelBuilder.Entity("Aaru.Database.Models.RemoteApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.Property("Version") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("RemoteApplications"); + }); + + modelBuilder.Entity("Aaru.Database.Models.RemoteArchitecture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("RemoteArchitectures"); + }); + + modelBuilder.Entity("Aaru.Database.Models.RemoteOperatingSystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.Property("Version") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("RemoteOperatingSystems"); + }); + + modelBuilder.Entity("Aaru.Database.Models.Report", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ATAId") + .HasColumnType("INTEGER"); + + b.Property("ATAPIId") + .HasColumnType("INTEGER"); + + b.Property("CompactFlash") + .HasColumnType("INTEGER"); + + b.Property("Created") + .HasColumnType("TEXT"); + + b.Property("FireWireId") + .HasColumnType("INTEGER"); + + b.Property("GdRomSwapDiscCapabilitiesId") + .HasColumnType("INTEGER"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("Model") + .HasColumnType("TEXT"); + + b.Property("MultiMediaCardId") + .HasColumnType("INTEGER"); + + b.Property("PCMCIAId") + .HasColumnType("INTEGER"); + + b.Property("Revision") + .HasColumnType("TEXT"); + + b.Property("SCSIId") + .HasColumnType("INTEGER"); + + b.Property("SecureDigitalId") + .HasColumnType("INTEGER"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("USBId") + .HasColumnType("INTEGER"); + + b.Property("Uploaded") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ATAId"); + + b.HasIndex("ATAPIId"); + + b.HasIndex("FireWireId"); + + b.HasIndex("GdRomSwapDiscCapabilitiesId"); + + b.HasIndex("MultiMediaCardId"); + + b.HasIndex("PCMCIAId"); + + b.HasIndex("SCSIId"); + + b.HasIndex("SecureDigitalId"); + + b.HasIndex("USBId"); + + b.ToTable("Reports"); + }); + + modelBuilder.Entity("Aaru.Database.Models.UsbProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AddedWhen") + .HasColumnType("TEXT"); + + b.Property("ModifiedWhen") + .HasColumnType("TEXT"); + + b.Property("Product") + .HasColumnType("TEXT"); + + b.Property("ProductId") + .HasColumnType("INTEGER"); + + b.Property("VendorId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ModifiedWhen"); + + b.HasIndex("ProductId"); + + b.HasIndex("VendorId"); + + b.ToTable("UsbProducts"); + }); + + modelBuilder.Entity("Aaru.Database.Models.UsbVendor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AddedWhen") + .HasColumnType("TEXT"); + + b.Property("ModifiedWhen") + .HasColumnType("TEXT"); + + b.Property("Vendor") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ModifiedWhen"); + + b.ToTable("UsbVendors"); + }); + + modelBuilder.Entity("Aaru.Database.Models.Version", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Count") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Synchronized") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Versions"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Ata", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", "ReadCapabilities") + .WithMany() + .HasForeignKey("ReadCapabilitiesId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("ReadCapabilities"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.BlockDescriptor", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", null) + .WithMany("BlockDescriptors") + .HasForeignKey("ScsiModeId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.CompressedBufferRead", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", null) + .WithMany("ReadBuffer3CReadBufferData") + .HasForeignKey("TestedMediaId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.DensityCode", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.SscSupportedMedia", null) + .WithMany("DensityCodes") + .HasForeignKey("SscSupportedMediaId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Mmc", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.MmcFeatures", "Features") + .WithMany() + .HasForeignKey("FeaturesId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Features"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Scsi", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", "ModeSense") + .WithMany() + .HasForeignKey("ModeSenseId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Mmc", "MultiMediaDevice") + .WithMany() + .HasForeignKey("MultiMediaDeviceId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", "ReadCapabilities") + .WithMany() + .HasForeignKey("ReadCapabilitiesId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Ssc", "SequentialDevice") + .WithMany() + .HasForeignKey("SequentialDeviceId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("ModeSense"); + + b.Navigation("MultiMediaDevice"); + + b.Navigation("ReadCapabilities"); + + b.Navigation("SequentialDevice"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.ScsiPage", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.Scsi", null) + .WithMany("EVPDPages") + .HasForeignKey("ScsiId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", null) + .WithMany("ModePages") + .HasForeignKey("ScsiModeId") + .OnDelete(DeleteBehavior.SetNull); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.SscSupportedMedia", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null) + .WithMany("SupportedMediaTypes") + .HasForeignKey("SscId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.TestedSequentialMedia", null) + .WithMany("SupportedMediaTypes") + .HasForeignKey("TestedSequentialMediaId") + .OnDelete(DeleteBehavior.SetNull); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.SupportedDensity", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null) + .WithMany("SupportedDensities") + .HasForeignKey("SscId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Aaru.CommonTypes.Metadata.TestedSequentialMedia", null) + .WithMany("SupportedDensities") + .HasForeignKey("TestedSequentialMediaId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedMedia", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.Ata", null) + .WithMany("RemovableMedias") + .HasForeignKey("AtaId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Chs", "CHS") + .WithMany() + .HasForeignKey("CHSId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Chs", "CurrentCHS") + .WithMany() + .HasForeignKey("CurrentCHSId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Mmc", null) + .WithMany("TestedMedia") + .HasForeignKey("MmcId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Aaru.CommonTypes.Metadata.Scsi", null) + .WithMany("RemovableMedias") + .HasForeignKey("ScsiId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CHS"); + + b.Navigation("CurrentCHS"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedSequentialMedia", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null) + .WithMany("TestedMedia") + .HasForeignKey("SscId") + .OnDelete(DeleteBehavior.SetNull); + }); + + modelBuilder.Entity("Aaru.Database.Models.Device", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATA") + .WithMany() + .HasForeignKey("ATAId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATAPI") + .WithMany() + .HasForeignKey("ATAPIId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.FireWire", "FireWire") + .WithMany() + .HasForeignKey("FireWireId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.GdRomSwapDiscCapabilities", "GdRomSwapDiscCapabilities") + .WithMany() + .HasForeignKey("GdRomSwapDiscCapabilitiesId"); + + b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "MultiMediaCard") + .WithMany() + .HasForeignKey("MultiMediaCardId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Pcmcia", "PCMCIA") + .WithMany() + .HasForeignKey("PCMCIAId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Scsi", "SCSI") + .WithMany() + .HasForeignKey("SCSIId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "SecureDigital") + .WithMany() + .HasForeignKey("SecureDigitalId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Usb", "USB") + .WithMany() + .HasForeignKey("USBId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("ATA"); + + b.Navigation("ATAPI"); + + b.Navigation("FireWire"); + + b.Navigation("GdRomSwapDiscCapabilities"); + + b.Navigation("MultiMediaCard"); + + b.Navigation("PCMCIA"); + + b.Navigation("SCSI"); + + b.Navigation("SecureDigital"); + + b.Navigation("USB"); + }); + + modelBuilder.Entity("Aaru.Database.Models.Report", b => + { + b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATA") + .WithMany() + .HasForeignKey("ATAId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATAPI") + .WithMany() + .HasForeignKey("ATAPIId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.FireWire", "FireWire") + .WithMany() + .HasForeignKey("FireWireId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.GdRomSwapDiscCapabilities", "GdRomSwapDiscCapabilities") + .WithMany() + .HasForeignKey("GdRomSwapDiscCapabilitiesId"); + + b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "MultiMediaCard") + .WithMany() + .HasForeignKey("MultiMediaCardId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Pcmcia", "PCMCIA") + .WithMany() + .HasForeignKey("PCMCIAId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Scsi", "SCSI") + .WithMany() + .HasForeignKey("SCSIId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "SecureDigital") + .WithMany() + .HasForeignKey("SecureDigitalId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Aaru.CommonTypes.Metadata.Usb", "USB") + .WithMany() + .HasForeignKey("USBId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("ATA"); + + b.Navigation("ATAPI"); + + b.Navigation("FireWire"); + + b.Navigation("GdRomSwapDiscCapabilities"); + + b.Navigation("MultiMediaCard"); + + b.Navigation("PCMCIA"); + + b.Navigation("SCSI"); + + b.Navigation("SecureDigital"); + + b.Navigation("USB"); + }); + + modelBuilder.Entity("Aaru.Database.Models.UsbProduct", b => + { + b.HasOne("Aaru.Database.Models.UsbVendor", "Vendor") + .WithMany("Products") + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Vendor"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Ata", b => + { + b.Navigation("RemovableMedias"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Mmc", b => + { + b.Navigation("TestedMedia"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Scsi", b => + { + b.Navigation("EVPDPages"); + + b.Navigation("RemovableMedias"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.ScsiMode", b => + { + b.Navigation("BlockDescriptors"); + + b.Navigation("ModePages"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.Ssc", b => + { + b.Navigation("SupportedDensities"); + + b.Navigation("SupportedMediaTypes"); + + b.Navigation("TestedMedia"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.SscSupportedMedia", b => + { + b.Navigation("DensityCodes"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedMedia", b => + { + b.Navigation("ReadBuffer3CReadBufferData"); + }); + + modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedSequentialMedia", b => + { + b.Navigation("SupportedDensities"); + + b.Navigation("SupportedMediaTypes"); + }); + + modelBuilder.Entity("Aaru.Database.Models.UsbVendor", b => + { + b.Navigation("Products"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Aaru.Database/Migrations/20260111083646_RenameLiteOnToReadBuffer3C.cs b/Aaru.Database/Migrations/20260111083646_RenameLiteOnToReadBuffer3C.cs new file mode 100644 index 000000000..6f689010f --- /dev/null +++ b/Aaru.Database/Migrations/20260111083646_RenameLiteOnToReadBuffer3C.cs @@ -0,0 +1,38 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Aaru.Database.Migrations +{ + /// + public partial class RenameLiteOnToReadBuffer3C : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "SupportsLiteOnReadRawDVD", + table: "TestedMedia", + newName: "SupportsReadBuffer3CRawDVD"); + + migrationBuilder.RenameColumn( + name: "LiteOnReadRawDVDData", + table: "TestedMedia", + newName: "ReadBuffer3CRawDVDData"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "SupportsReadBuffer3CRawDVD", + table: "TestedMedia", + newName: "SupportsLiteOnReadRawDVD"); + + migrationBuilder.RenameColumn( + name: "ReadBuffer3CRawDVDData", + table: "TestedMedia", + newName: "LiteOnReadRawDVDData"); + } + } +} diff --git a/Aaru.Database/Migrations/AaruContextModelSnapshot.cs b/Aaru.Database/Migrations/AaruContextModelSnapshot.cs index bc07d648a..c7b5e6cb4 100644 --- a/Aaru.Database/Migrations/AaruContextModelSnapshot.cs +++ b/Aaru.Database/Migrations/AaruContextModelSnapshot.cs @@ -1672,9 +1672,6 @@ namespace Aaru.Database.Migrations b.Property("LeadOutData") .HasColumnType("BLOB"); - b.Property("LiteOnReadRawDVDData") - .HasColumnType("BLOB"); - b.Property("LogicalAlignment") .HasColumnType("INTEGER"); @@ -1759,6 +1756,9 @@ namespace Aaru.Database.Migrations b.Property("Read6Data") .HasColumnType("BLOB"); + b.Property("ReadBuffer3CRawDVDData") + .HasColumnType("BLOB"); + b.Property("ReadCdData") .HasColumnType("BLOB"); @@ -1837,9 +1837,6 @@ namespace Aaru.Database.Migrations b.Property("SupportsHLDTSTReadRawDVD") .HasColumnType("INTEGER"); - b.Property("SupportsLiteOnReadRawDVD") - .HasColumnType("INTEGER"); - b.Property("SupportsNECReadCDDA") .HasColumnType("INTEGER"); @@ -1867,6 +1864,9 @@ namespace Aaru.Database.Migrations b.Property("SupportsRead6") .HasColumnType("INTEGER"); + b.Property("SupportsReadBuffer3CRawDVD") + .HasColumnType("INTEGER"); + b.Property("SupportsReadCapacity") .HasColumnType("INTEGER"); @@ -2638,7 +2638,7 @@ namespace Aaru.Database.Migrations modelBuilder.Entity("Aaru.CommonTypes.Metadata.CompressedBufferRead", b => { b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", null) - .WithMany("LiteOnReadBufferData") + .WithMany("ReadBuffer3CReadBufferData") .HasForeignKey("TestedMediaId") .OnDelete(DeleteBehavior.Cascade); }); @@ -2952,7 +2952,7 @@ namespace Aaru.Database.Migrations modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedMedia", b => { - b.Navigation("LiteOnReadBufferData"); + b.Navigation("ReadBuffer3CReadBufferData"); }); modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedSequentialMedia", b => diff --git a/Aaru.Devices/Device/ScsiCommands/LiteOn.cs b/Aaru.Devices/Device/ScsiCommands/LiteOn.cs deleted file mode 100644 index e5065db70..000000000 --- a/Aaru.Devices/Device/ScsiCommands/LiteOn.cs +++ /dev/null @@ -1,360 +0,0 @@ -// /*************************************************************************** -// Aaru Data Preservation Suite -// ---------------------------------------------------------------------------- -// -// Filename : LiteOn.cs -// Author(s) : Rebecca Wallander -// -// Component : LiteOn vendor commands. -// -// --[ Description ] ---------------------------------------------------------- -// -// Contains vendor commands for Lite-On SCSI devices. -// -// --[ License ] -------------------------------------------------------------- -// -// This library is free software; you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 2.1 of the -// License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2011-2026 Rebecca Wallander -// ****************************************************************************/ - -using System; -using Aaru.CommonTypes.Enums; -using Aaru.Logging; - -namespace Aaru.Devices; - -public partial class Device -{ - private enum LiteOnBufferFormat - { - Unknown = 0, - FullEccInterleaved, - PoOnly, - SectorDataOnly, - FullEccWithPadding - } - - private uint _bufferOffset; - private uint _bufferCapacityInSectors; - private LiteOnBufferFormat _bufferFormat; - private uint _totalSectorsRead; // Tracks cumulative sectors read successfully since last buffer reset - - /// Reads a "raw" sector from DVD on Lite-On drives. - /// true if the command failed and contains the sense buffer. - /// Buffer where the ReadBuffer (RAW) response will be stored - /// Sense buffer. - /// Start block address. - /// How many blocks to read. - /// Timeout in seconds. - /// Duration in milliseconds it took for the device to execute the command. - /// The address in which the layerbreak occur - /// Set to true if disk is Opposite Track Path (OTP) - public bool LiteOnReadRawDvd(out byte[] buffer, out ReadOnlySpan senseBuffer, uint lba, uint transferLength, - uint timeout, out double duration, uint layerbreak, bool otp) - { - // Detect ReadBuffer 3C variant and stride on first call - if(!_readBuffer3CDetected) - { - bool detected = DetectReadBuffer3C(lba, timeout, out double detectDuration); - - if(!detected || _detectedBufferStride == 0 || _detectedBufferStride < 2064 || _detectedBufferStride > 10000) - { - // Detection failed - raw reading is not supported on this drive - AaruLogging.Debug(SCSI_MODULE_NAME, - "ReadBuffer 3C detection failed - raw reading is not supported on this drive"); - - buffer = Array.Empty(); - senseBuffer = SenseBuffer; - duration = detectDuration; - Error = true; - _readBuffer3CDetected = true; - - return true; // Return failure - raw reading not supported - } - - // Detect format based on stride (Lite-On specific) - _bufferFormat = _detectedBufferStride switch - { - 2064 => LiteOnBufferFormat.SectorDataOnly, - 2236 => LiteOnBufferFormat.PoOnly, - 2384 => LiteOnBufferFormat.FullEccInterleaved, - > 2384 => LiteOnBufferFormat.FullEccWithPadding, - _ => LiteOnBufferFormat.FullEccInterleaved // Default for backward compatibility - }; - - AaruLogging.Debug(SCSI_MODULE_NAME, - "LiteOn buffer format detected based on stride: {0}, format: {1}", - _detectedBufferStride, _bufferFormat); - - // Initialize buffer capacity with default value (will be refined dynamically when offset is lost) - // Buffer size is approximately 1,700,576 bytes but need to test on other drives to get the correct value - // It might also be the case that the buffer overflow works differently on different drives, so we need to test that as well. - // const uint BUFFER_SIZE = 1700576; - // _bufferCapacityInSectors = BUFFER_SIZE / _detectedBufferStride; - // if(_bufferCapacityInSectors == 0) _bufferCapacityInSectors = 714; // Fallback to known value - _bufferCapacityInSectors = 714; - _totalSectorsRead = 0; // Initialize tracking for dynamic capacity detection - _readBuffer3CDetected = true; - } - - _bufferOffset %= _bufferCapacityInSectors; - - bool sense; - - if(layerbreak > 0 && transferLength > 1 && lba + 0x30000 > layerbreak - 256 && lba + 0x30000 < layerbreak + 256) - { - buffer = new byte[transferLength * 2064]; - duration = 0; - senseBuffer = SenseBuffer; - - return true; - } - - if(_bufferCapacityInSectors - _bufferOffset < transferLength) - { - sense = LiteOnReadSectorsAcrossBufferBorder(out buffer, - out senseBuffer, - lba, - transferLength, - timeout, - out duration, - layerbreak, - otp); - } - else - { - sense = LiteOnReadSectorsFromBuffer(out buffer, - out senseBuffer, - lba, - transferLength, - timeout, - out duration, - layerbreak, - otp); - } - - Error = LastError != 0; - - AaruLogging.Debug(SCSI_MODULE_NAME, Localization.LiteOn_READ_DVD_RAW_took_0_ms, duration); - - return sense; - } - - /// - /// Reads the Lite-On device's memory buffer and returns raw sector data - /// - /// Buffer where the ReadBuffer (RAW) response will be stored - /// Sense buffer. - /// The offset to read the buffer at - /// How many blocks to read. - /// Timeout in seconds. - /// Duration in milliseconds it took for the device to execute the command. - /// Start block address. - /// true if the command failed and contains the sense buffer. - private bool LiteOnReadBuffer(out byte[] buffer, out ReadOnlySpan senseBuffer, uint bufferOffset, - uint transferLength, uint timeout, out double duration, uint lba) - { - // We need to fill the buffer before reading it with the ReadBuffer command. We don't care about sense, - // because the data can be wrong anyway, so we check the buffer data later instead. - Read12(out _, out _, 0, false, false, false, false, lba, 2048, 0, 16, false, timeout, out duration); - - // Use generic ReadBuffer method with detected variant - return ScsiReadBuffer(out buffer, out senseBuffer, bufferOffset, transferLength, timeout, out duration, - _detectedReadBufferMode, _detectedReadBufferId); - } - - /// - /// Reads raw sectors from the device's memory - /// - /// true if the command failed and contains the sense buffer. - /// Buffer where the ReadBuffer (RAW) response will be stored - /// Sense buffer. - /// Timeout in seconds. - /// Duration in milliseconds it took for the device to execute the command. - /// Start block address. - /// How many blocks to read. - /// The address in which the layerbreak occur - /// Set to true if disk is Opposite Track Path (OTP) - private bool LiteOnReadSectorsFromBuffer(out byte[] buffer, out ReadOnlySpan senseBuffer, uint lba, - uint transferLength, uint timeout, out double duration, uint layerbreak, - bool otp) - { - bool sense = LiteOnReadBuffer(out buffer, - out senseBuffer, - _bufferOffset * _detectedBufferStride, - transferLength * _detectedBufferStride, - timeout, - out duration, - lba); - - byte[] deinterleaved = DeinterleaveEccBlock(buffer, transferLength, _detectedBufferStride, _bufferFormat); - - if(!CheckSectorNumber(deinterleaved, lba, transferLength, layerbreak, true)) - { - // Buffer offset lost - this means we've wrapped around - // Use the number of sectors read to detect buffer capacity - if(_totalSectorsRead > 0 && _totalSectorsRead >= 16 && _totalSectorsRead <= 2000) - { - uint detectedCapacity = _totalSectorsRead; - uint oldCapacity = _bufferCapacityInSectors; - - // If we already have a capacity, verify new detection is consistent - if(_bufferCapacityInSectors == 714 || // Update if using default - (detectedCapacity >= _bufferCapacityInSectors * 9 / 10 && - detectedCapacity <= _bufferCapacityInSectors * 11 / 10)) // Or within 10% - { - _bufferCapacityInSectors = detectedCapacity; - AaruLogging.Debug(SCSI_MODULE_NAME, - "Buffer capacity dynamically detected: {0} sectors (was {1})", - detectedCapacity, oldCapacity); - } - } - - // Reset tracking for next cycle - _totalSectorsRead = 0; - - // Buffer offset lost, try to find it again - int offset = FindBufferOffset(lba, timeout, layerbreak, otp); - - if(offset == -1) return true; - - _bufferOffset = (uint)offset; - - sense = LiteOnReadBuffer(out buffer, - out senseBuffer, - _bufferOffset * _detectedBufferStride, - transferLength * _detectedBufferStride, - timeout, - out duration, - lba); - - deinterleaved = DeinterleaveEccBlock(buffer, transferLength, _detectedBufferStride, _bufferFormat); - - if(!CheckSectorNumber(deinterleaved, lba, transferLength, layerbreak, otp)) return true; - } - - if(_decoding.Scramble(deinterleaved, transferLength, out byte[] scrambledBuffer) != ErrorNumber.NoError) - return true; - - buffer = scrambledBuffer; - - _bufferOffset += transferLength; - _totalSectorsRead += transferLength; // Track successful read for capacity detection - - return sense; - } - - /// - /// Reads raw sectors when they cross the device's memory border - /// - /// true if the command failed and contains the sense buffer. - /// Buffer where the ReadBuffer (RAW) response will be stored - /// Sense buffer. - /// Timeout in seconds. - /// Duration in milliseconds it took for the device to execute the command. - /// Start block address. - /// How many blocks to read. - /// The address in which the layerbreak occur - /// Set to true if disk is Opposite Track Path (OTP) - private bool LiteOnReadSectorsAcrossBufferBorder(out byte[] buffer, out ReadOnlySpan senseBuffer, uint lba, - uint transferLength, uint timeout, out double duration, - uint layerbreak, bool otp) - { - uint newTransferLength1 = _bufferCapacityInSectors - _bufferOffset; - uint newTransferLength2 = transferLength - newTransferLength1; - - bool sense1 = LiteOnReadBuffer(out byte[] buffer1, - out _, - _bufferOffset * _detectedBufferStride, - newTransferLength1 * _detectedBufferStride, - timeout, - out double duration1, - lba); - - bool sense2 = LiteOnReadBuffer(out byte[] buffer2, - out _, - 0, - newTransferLength2 * _detectedBufferStride, - timeout, - out double duration2, - lba); - - senseBuffer = SenseBuffer; // TODO - - buffer = new byte[_detectedBufferStride * transferLength]; - Array.Copy(buffer1, buffer, buffer1.Length); - Array.Copy(buffer2, 0, buffer, buffer1.Length, buffer2.Length); - - duration = duration1 + duration2; - - byte[] deinterleaved = DeinterleaveEccBlock(buffer, transferLength, _detectedBufferStride, _bufferFormat); - - if(!CheckSectorNumber(deinterleaved, lba, transferLength, layerbreak, otp)) return true; - - if(_decoding.Scramble(deinterleaved, transferLength, out byte[] scrambledBuffer) != ErrorNumber.NoError) - return true; - - buffer = scrambledBuffer; - - _bufferOffset = newTransferLength2; - _totalSectorsRead += transferLength; // Track successful read for capacity detection - - return sense1 && sense2; - } - - /// - /// Sometimes the offset on the drive memory can get lost. This tries to find it again. - /// - /// The expected LBA - /// Timeout in seconds. - /// The address in which the layerbreak occur - /// Set to true if disk is Opposite Track Path (OTP) - /// The offset on the device memory, or -1 if not found - private int FindBufferOffset(uint lba, uint timeout, uint layerbreak, bool otp) - { - for(uint i = 0; i < _bufferCapacityInSectors; i++) - { - LiteOnReadBuffer(out byte[] buffer, out _, i * _detectedBufferStride, _detectedBufferStride, timeout, - out double _, lba); - - byte[] deinterleaved = DeinterleaveEccBlock(buffer, 1, _detectedBufferStride, _bufferFormat); - - if(CheckSectorNumber(deinterleaved, lba, 1, layerbreak, otp)) return (int)i; - } - - return -1; - } - - /// - /// Deinterleave the ECC block based on detected format - /// - /// Data buffer - /// How many blocks in buffer - /// Bytes per sector in buffer - /// Buffer format type - /// The deinterleaved sectors - private byte[] DeinterleaveEccBlock(byte[] buffer, uint transferLength, uint stride, LiteOnBufferFormat format) - { - return format switch - { - LiteOnBufferFormat.FullEccInterleaved => DeinterleaveFullEccInterleaved(buffer, transferLength, stride), - LiteOnBufferFormat.PoOnly => DeinterleavePoOnly(buffer, transferLength, stride), - LiteOnBufferFormat.SectorDataOnly => buffer, // No deinterleaving needed for sector-data-only format - LiteOnBufferFormat.FullEccWithPadding => DeinterleaveFullEccWithPadding(buffer, transferLength, stride), - _ => DeinterleaveFullEccInterleaved(buffer, transferLength, stride) // Default fallback - }; - } -} \ No newline at end of file diff --git a/Aaru.Devices/Device/ScsiCommands/ReadBuffer.cs b/Aaru.Devices/Device/ScsiCommands/ReadBuffer.cs index 485da6edd..50de96de6 100644 --- a/Aaru.Devices/Device/ScsiCommands/ReadBuffer.cs +++ b/Aaru.Devices/Device/ScsiCommands/ReadBuffer.cs @@ -32,6 +32,7 @@ using System; using System.Collections.Generic; +using Aaru.CommonTypes.Enums; using Aaru.Helpers; using Aaru.Logging; @@ -44,6 +45,21 @@ public partial class Device private byte _detectedReadBufferId; // Detected buffer ID (0x00, 0x01, 0x02) private uint _detectedBufferStride; // Detected stride in bytes per sector private bool _readBuffer3CDetected; // Flag to track if detection has been performed + + // Buffer format and management fields + private enum BufferFormat + { + Unknown = 0, + FullEccInterleaved, + PoOnly, + SectorDataOnly, + FullEccWithPadding + } + + private uint _bufferOffset; + private uint _bufferCapacityInSectors; + private BufferFormat _bufferFormat; + private uint _totalSectorsRead; // Tracks cumulative sectors read successfully since last buffer reset /// Reads from device buffer using SCSI READ BUFFER command with specified variant /// true if the command failed and contains the sense buffer. /// Buffer where the ReadBuffer response will be stored @@ -409,5 +425,306 @@ public partial class Device return true; } + + /// Reads a "raw" sector from DVD using ReadBuffer 3C command. + /// true if the command failed and contains the sense buffer. + /// Buffer where the ReadBuffer (RAW) response will be stored + /// Sense buffer. + /// Start block address. + /// How many blocks to read. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// The address in which the layerbreak occur + /// Set to true if disk is Opposite Track Path (OTP) + public bool ReadBuffer3CRawDvd(out byte[] buffer, out ReadOnlySpan senseBuffer, uint lba, uint transferLength, + uint timeout, out double duration, uint layerbreak, bool otp) + { + // Detect ReadBuffer 3C variant and stride on first call + if(!_readBuffer3CDetected) + { + bool detected = DetectReadBuffer3C(lba, timeout, out double detectDuration); + + if(!detected || _detectedBufferStride == 0 || _detectedBufferStride < 2064 || _detectedBufferStride > 10000) + { + // Detection failed - raw reading is not supported on this drive + AaruLogging.Debug(SCSI_MODULE_NAME, + "ReadBuffer 3C detection failed - raw reading is not supported on this drive"); + + buffer = Array.Empty(); + senseBuffer = SenseBuffer; + duration = detectDuration; + Error = true; + _readBuffer3CDetected = true; + + return true; // Return failure - raw reading not supported + } + + // Detect format based on stride + _bufferFormat = _detectedBufferStride switch + { + 2064 => BufferFormat.SectorDataOnly, + 2236 => BufferFormat.PoOnly, + 2384 => BufferFormat.FullEccInterleaved, + > 2384 => BufferFormat.FullEccWithPadding, + _ => BufferFormat.FullEccInterleaved // Default for backward compatibility + }; + + AaruLogging.Debug(SCSI_MODULE_NAME, + "ReadBuffer 3C buffer format detected based on stride: {0}, format: {1}", + _detectedBufferStride, _bufferFormat); + + // Initialize buffer capacity with default value (will be refined dynamically when offset is lost) + _bufferCapacityInSectors = 714; + _totalSectorsRead = 0; // Initialize tracking for dynamic capacity detection + _readBuffer3CDetected = true; + } + + _bufferOffset %= _bufferCapacityInSectors; + + bool sense; + + if(layerbreak > 0 && transferLength > 1 && lba + 0x30000 > layerbreak - 256 && lba + 0x30000 < layerbreak + 256) + { + buffer = new byte[transferLength * 2064]; + duration = 0; + senseBuffer = SenseBuffer; + + return true; + } + + if(_bufferCapacityInSectors - _bufferOffset < transferLength) + { + sense = ReadSectorsAcrossBufferBorder(out buffer, + out senseBuffer, + lba, + transferLength, + timeout, + out duration, + layerbreak, + otp); + } + else + { + sense = ReadSectorsFromBuffer(out buffer, + out senseBuffer, + lba, + transferLength, + timeout, + out duration, + layerbreak, + otp); + } + + Error = LastError != 0; + + AaruLogging.Debug(SCSI_MODULE_NAME, "ReadBuffer 3C READ DVD RAW took {0} ms", duration); + + return sense; + } + + /// + /// Reads the device's memory buffer and returns raw sector data + /// + /// Buffer where the ReadBuffer (RAW) response will be stored + /// Sense buffer. + /// The offset to read the buffer at + /// How many blocks to read. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// Start block address. + /// true if the command failed and contains the sense buffer. + private bool ReadBuffer3CInternal(out byte[] buffer, out ReadOnlySpan senseBuffer, uint bufferOffset, + uint transferLength, uint timeout, out double duration, uint lba) + { + // We need to fill the buffer before reading it with the ReadBuffer command. We don't care about sense, + // because the data can be wrong anyway, so we check the buffer data later instead. + Read12(out _, out _, 0, false, false, false, false, lba, 2048, 0, 16, false, timeout, out duration); + + // Use generic ReadBuffer method with detected variant + return ScsiReadBuffer(out buffer, out senseBuffer, bufferOffset, transferLength, timeout, out duration, + _detectedReadBufferMode, _detectedReadBufferId); + } + + /// + /// Reads raw sectors from the device's memory + /// + /// true if the command failed and contains the sense buffer. + /// Buffer where the ReadBuffer (RAW) response will be stored + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// Start block address. + /// How many blocks to read. + /// The address in which the layerbreak occur + /// Set to true if disk is Opposite Track Path (OTP) + private bool ReadSectorsFromBuffer(out byte[] buffer, out ReadOnlySpan senseBuffer, uint lba, + uint transferLength, uint timeout, out double duration, uint layerbreak, + bool otp) + { + bool sense = ReadBuffer3CInternal(out buffer, + out senseBuffer, + _bufferOffset * _detectedBufferStride, + transferLength * _detectedBufferStride, + timeout, + out duration, + lba); + + byte[] deinterleaved = DeinterleaveEccBlock(buffer, transferLength, _detectedBufferStride, _bufferFormat); + + if(!CheckSectorNumber(deinterleaved, lba, transferLength, layerbreak, true)) + { + // Buffer offset lost - this means we've wrapped around + // Use the number of sectors read to detect buffer capacity + if(_totalSectorsRead > 0 && _totalSectorsRead >= 16 && _totalSectorsRead <= 2000) + { + uint detectedCapacity = _totalSectorsRead; + uint oldCapacity = _bufferCapacityInSectors; + + // If we already have a capacity, verify new detection is consistent + if(_bufferCapacityInSectors == 714 || // Update if using default + (detectedCapacity >= _bufferCapacityInSectors * 9 / 10 && + detectedCapacity <= _bufferCapacityInSectors * 11 / 10)) // Or within 10% + { + _bufferCapacityInSectors = detectedCapacity; + AaruLogging.Debug(SCSI_MODULE_NAME, + "Buffer capacity dynamically detected: {0} sectors (was {1})", + detectedCapacity, oldCapacity); + } + } + + // Reset tracking for next cycle + _totalSectorsRead = 0; + + // Buffer offset lost, try to find it again + int offset = FindBufferOffset(lba, timeout, layerbreak, otp); + + if(offset == -1) return true; + + _bufferOffset = (uint)offset; + + sense = ReadBuffer3CInternal(out buffer, + out senseBuffer, + _bufferOffset * _detectedBufferStride, + transferLength * _detectedBufferStride, + timeout, + out duration, + lba); + + deinterleaved = DeinterleaveEccBlock(buffer, transferLength, _detectedBufferStride, _bufferFormat); + + if(!CheckSectorNumber(deinterleaved, lba, transferLength, layerbreak, otp)) return true; + } + + if(_decoding.Scramble(deinterleaved, transferLength, out byte[] scrambledBuffer) != ErrorNumber.NoError) + return true; + + buffer = scrambledBuffer; + + _bufferOffset += transferLength; + _totalSectorsRead += transferLength; // Track successful read for capacity detection + + return sense; + } + + /// + /// Reads raw sectors when they cross the device's memory border + /// + /// true if the command failed and contains the sense buffer. + /// Buffer where the ReadBuffer (RAW) response will be stored + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// Start block address. + /// How many blocks to read. + /// The address in which the layerbreak occur + /// Set to true if disk is Opposite Track Path (OTP) + private bool ReadSectorsAcrossBufferBorder(out byte[] buffer, out ReadOnlySpan senseBuffer, uint lba, + uint transferLength, uint timeout, out double duration, + uint layerbreak, bool otp) + { + uint newTransferLength1 = _bufferCapacityInSectors - _bufferOffset; + uint newTransferLength2 = transferLength - newTransferLength1; + + bool sense1 = ReadBuffer3CInternal(out byte[] buffer1, + out _, + _bufferOffset * _detectedBufferStride, + newTransferLength1 * _detectedBufferStride, + timeout, + out double duration1, + lba); + + bool sense2 = ReadBuffer3CInternal(out byte[] buffer2, + out _, + 0, + newTransferLength2 * _detectedBufferStride, + timeout, + out double duration2, + lba); + + senseBuffer = SenseBuffer; // TODO + + buffer = new byte[_detectedBufferStride * transferLength]; + Array.Copy(buffer1, buffer, buffer1.Length); + Array.Copy(buffer2, 0, buffer, buffer1.Length, buffer2.Length); + + duration = duration1 + duration2; + + byte[] deinterleaved = DeinterleaveEccBlock(buffer, transferLength, _detectedBufferStride, _bufferFormat); + + if(!CheckSectorNumber(deinterleaved, lba, transferLength, layerbreak, otp)) return true; + + if(_decoding.Scramble(deinterleaved, transferLength, out byte[] scrambledBuffer) != ErrorNumber.NoError) + return true; + + buffer = scrambledBuffer; + + _bufferOffset = newTransferLength2; + _totalSectorsRead += transferLength; // Track successful read for capacity detection + + return sense1 && sense2; + } + + /// + /// Sometimes the offset on the drive memory can get lost. This tries to find it again. + /// + /// The expected LBA + /// Timeout in seconds. + /// The address in which the layerbreak occur + /// Set to true if disk is Opposite Track Path (OTP) + /// The offset on the device memory, or -1 if not found + private int FindBufferOffset(uint lba, uint timeout, uint layerbreak, bool otp) + { + for(uint i = 0; i < _bufferCapacityInSectors; i++) + { + ReadBuffer3CInternal(out byte[] buffer, out _, i * _detectedBufferStride, _detectedBufferStride, timeout, + out double _, lba); + + byte[] deinterleaved = DeinterleaveEccBlock(buffer, 1, _detectedBufferStride, _bufferFormat); + + if(CheckSectorNumber(deinterleaved, lba, 1, layerbreak, otp)) return (int)i; + } + + return -1; + } + + /// + /// Deinterleave the ECC block based on detected format + /// + /// Data buffer + /// How many blocks in buffer + /// Bytes per sector in buffer + /// Buffer format type + /// The deinterleaved sectors + private byte[] DeinterleaveEccBlock(byte[] buffer, uint transferLength, uint stride, BufferFormat format) + { + return format switch + { + BufferFormat.FullEccInterleaved => DeinterleaveFullEccInterleaved(buffer, transferLength, stride), + BufferFormat.PoOnly => DeinterleavePoOnly(buffer, transferLength, stride), + BufferFormat.SectorDataOnly => buffer, // No deinterleaving needed for sector-data-only format + BufferFormat.FullEccWithPadding => DeinterleaveFullEccWithPadding(buffer, transferLength, stride), + _ => DeinterleaveFullEccInterleaved(buffer, transferLength, stride) // Default fallback + }; + } } diff --git a/Aaru.Localization/Core.Designer.cs b/Aaru.Localization/Core.Designer.cs index 35c1b3484..3f4827d39 100644 --- a/Aaru.Localization/Core.Designer.cs +++ b/Aaru.Localization/Core.Designer.cs @@ -6839,6 +6839,12 @@ namespace Aaru.Localization { } } + public static string Using_ReadBuffer_3C_raw_DVD_reading { + get { + return ResourceManager.GetString("Using_ReadBuffer_3C_raw_DVD_reading", resourceCulture); + } + } + public static string Filesystems_Identify_Error { get { return ResourceManager.GetString("Filesystems_Identify_Error", resourceCulture); diff --git a/Aaru.Localization/Core.resx b/Aaru.Localization/Core.resx index dd172438f..81356051d 100644 --- a/Aaru.Localization/Core.resx +++ b/Aaru.Localization/Core.resx @@ -3490,6 +3490,9 @@ It has no sense to do it, and it will put too much strain on the tape. [slateblue1]Using [fuchsia]Lite-On raw DVD[/] reading[/] + + [slateblue1]Using [fuchsia]ReadBuffer 3C raw DVD[/] reading[/] + Error identifying filesystem {0}. Please open a report with the following line in a Github issue.