Merge Aaru.Dto into devel

This commit is contained in:
2023-12-19 13:45:56 +00:00
9 changed files with 2512 additions and 0 deletions

1342
Aaru.Dto/.editorconfig Normal file

File diff suppressed because it is too large Load Diff

595
Aaru.Dto/.gitignore vendored Normal file
View File

@@ -0,0 +1,595 @@
### VisualStudio template
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
### Linux template
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### Xcode template
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## User settings
xcuserdata/
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
### VisualStudioCode template
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
### C++ template
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
# Precompiled Headers
*.gch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
### MonoDevelop template
#User Specific
*.usertasks
#Mono Project Files
*.resources
test-results/
### GPG template
secring.*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
### CMake template
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
### C template
# Object files
*.ko
*.elf
# Linker output
*.map
*.exp
*.so.*
# Executables
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
### Windows template
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# NuGet Packages Directory
packages/
## TODO: If the tool you use requires repositories.config uncomment the next line
#!packages/repositories.config
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented)
!packages/build/
# Others
sql/
*.Cache
# Visual Studio 2017
.vs
workspace.xml
cmake-build-debug
### macOS template
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
pkg/**/pkg
pkg/**/src
pkg/**/*.asc
pkg/**/*.sig
pkg/**/*.tar.xz
pkg/**/*.zip
pkg/**/aaru
.sonarqube

55
Aaru.Dto/Aaru.Dto.csproj Normal file
View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F4399FF5-9BD0-475A-9EA7-3DAE45291FE2}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Aaru.Dto</RootNamespace>
<AssemblyName>Aaru.Dto</AssemblyName>
<ReleaseVersion>$(Version)</ReleaseVersion>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>6.0.0-alpha9</Version>
<Company>Claunia.com</Company>
<Copyright>Copyright © 2011-2023 Natalia Portillo</Copyright>
<Product>Aaru Data Preservation Suite</Product>
<Title>Aaru.Dto</Title>
<ApplicationVersion>$(Version)</ApplicationVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<Description>Data transfer objects used to interchange data between Aaru and Aaru.Server.</Description>
<PackageProjectUrl>https://github.com/aaru-dps/</PackageProjectUrl>
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
<RepositoryUrl>https://github.com/aaru-dps/Aaru</RepositoryUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NeutralLanguage>en-US</NeutralLanguage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Authors>Natalia Portillo &lt;claunia@claunia.com&gt;</Authors>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<NoWarn>CS1591;CS1574</NoWarn>
</PropertyGroup>
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<InternalsVisibleTo Include="Aaru.Tests"/>
<InternalsVisibleTo Include="Aaru.Tests.Devices"/>
</ItemGroup>
<PropertyGroup>
<NrtRevisionFormat>$(Version)+{chash:8}</NrtRevisionFormat>
<NrtResolveSimpleAttributes>true</NrtResolveSimpleAttributes>
<NrtShowRevision>true</NrtShowRevision>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="..\LICENSE.LGPL">
<Link>LICENSE.LGPL</Link>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aaru.CommonTypes\Aaru.CommonTypes.csproj"/>
</ItemGroup>
</Project>

61
Aaru.Dto/CdOffsetDto.cs Normal file
View File

@@ -0,0 +1,61 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : CdOffsetDto.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DTOs.
//
// --[ Description ] ----------------------------------------------------------
//
// DTO for syncing Compact Disc read offsets.
//
// --[ 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 <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2023 Natalia Portillo
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
using Aaru.CommonTypes.Metadata;
namespace Aaru.Dto;
/// <inheritdoc />
/// <summary>DTO from a CD drive read offset</summary>
[SuppressMessage("ReSharper", "UnusedMember.Global")]
public class CdOffsetDto : CdOffset
{
/// <summary>Build an empty DTO</summary>
public CdOffsetDto() {}
/// <summary>Build a DTO using the specified offset and database ID</summary>
/// <param name="offset">CD reading offset</param>
/// <param name="id">Database ID</param>
public CdOffsetDto(CdOffset offset, int id)
{
Manufacturer = offset.Manufacturer;
Model = offset.Model;
Offset = offset.Offset;
Submissions = offset.Submissions;
Agreement = offset.Agreement;
Id = id;
}
/// <summary>Database ID</summary>
public int Id { get; set; }
}

265
Aaru.Dto/DeviceDto.cs Normal file
View File

@@ -0,0 +1,265 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : DeviceDto.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// DTO for syncing processed device reports in database.
//
// --[ 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 <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2023 Natalia Portillo
// ****************************************************************************/
// ReSharper disable VirtualMemberCallInConstructor
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Aaru.CommonTypes.Metadata;
namespace Aaru.Dto;
/// <summary>DTO for known device</summary>
[SuppressMessage("ReSharper", "UnusedMember.Global")]
public class DeviceDto : DeviceReport
{
/// <summary>Build an empty DTO</summary>
public DeviceDto() {}
/// <summary>Build a DTO from a device report</summary>
/// <param name="report">Device report</param>
public DeviceDto(DeviceReport report)
{
ATA = report.ATA;
ATAPI = report.ATAPI;
CompactFlash = report.CompactFlash;
FireWire = report.FireWire;
MultiMediaCard = report.MultiMediaCard;
PCMCIA = report.PCMCIA;
SCSI = report.SCSI;
SecureDigital = report.SecureDigital;
USB = report.USB;
Manufacturer = report.Manufacturer;
Model = report.Model;
Revision = report.Revision;
Type = report.Type;
GdRomSwapDiscCapabilities = report.GdRomSwapDiscCapabilities;
}
/// <summary>Build a DTO from a device report with the specified parameters</summary>
/// <param name="report">Device report</param>
/// <param name="id">Database ID</param>
/// <param name="optimalMultipleSectorsRead">Optimal number of blocks for read</param>
/// <param name="canReadGdRomUsingSwapDisc">Can read GD-ROM using swap trick?</param>
public DeviceDto(DeviceReport report, int id, int optimalMultipleSectorsRead, bool? canReadGdRomUsingSwapDisc)
{
ATA = report.ATA;
ATAPI = report.ATAPI;
CompactFlash = report.CompactFlash;
FireWire = report.FireWire;
MultiMediaCard = report.MultiMediaCard;
PCMCIA = report.PCMCIA;
SCSI = report.SCSI;
SecureDigital = report.SecureDigital;
USB = report.USB;
Manufacturer = report.Manufacturer;
Model = report.Model;
Revision = report.Revision;
Type = report.Type;
GdRomSwapDiscCapabilities = report.GdRomSwapDiscCapabilities;
if(ATA != null)
{
ATA.Identify = null;
ATA.ReadCapabilities = ClearBinaries(ATA.ReadCapabilities);
if(ATA.RemovableMedias != null)
{
TestedMedia[] medias = ATA.RemovableMedias.ToArray();
ATA.RemovableMedias = new List<TestedMedia>();
foreach(TestedMedia media in medias)
ATA.RemovableMedias.Add(ClearBinaries(media));
}
}
if(ATAPI != null)
{
ATAPI.Identify = null;
ATAPI.ReadCapabilities = ClearBinaries(ATAPI.ReadCapabilities);
if(ATAPI.RemovableMedias != null)
{
TestedMedia[] medias = ATAPI.RemovableMedias.ToArray();
ATAPI.RemovableMedias = new List<TestedMedia>();
foreach(TestedMedia media in medias)
ATAPI.RemovableMedias.Add(ClearBinaries(media));
}
}
if(PCMCIA != null)
{
PCMCIA.AdditionalInformation = null;
PCMCIA.CIS = null;
}
MultiMediaCard = null;
SecureDigital = null;
if(SCSI != null)
{
SCSI.EVPDPages = null;
SCSI.InquiryData = null;
SCSI.ModeSense6Data = null;
SCSI.ModeSense10Data = null;
SCSI.ModeSense6CurrentData = null;
SCSI.ModeSense10CurrentData = null;
SCSI.ModeSense6ChangeableData = null;
SCSI.ModeSense10ChangeableData = null;
SCSI.ReadCapabilities = ClearBinaries(SCSI.ReadCapabilities);
if(SCSI.ModeSense != null)
{
SCSI.ModeSense.BlockDescriptors = null;
SCSI.ModeSense.ModePages = null;
}
if(SCSI.RemovableMedias != null)
{
TestedMedia[] medias = SCSI.RemovableMedias.ToArray();
SCSI.RemovableMedias = new List<TestedMedia>();
foreach(TestedMedia media in medias)
SCSI.RemovableMedias.Add(ClearBinaries(media));
}
if(SCSI.MultiMediaDevice != null)
{
SCSI.MultiMediaDevice.ModeSense2AData = null;
if(SCSI.MultiMediaDevice.Features != null)
SCSI.MultiMediaDevice.Features.BinaryData = null;
if(SCSI.MultiMediaDevice.TestedMedia != null)
{
TestedMedia[] medias = SCSI.MultiMediaDevice.TestedMedia.ToArray();
SCSI.MultiMediaDevice.TestedMedia = new List<TestedMedia>();
foreach(TestedMedia media in medias)
SCSI.MultiMediaDevice.TestedMedia.Add(ClearBinaries(media));
}
}
SCSI.SequentialDevice = null;
}
if(USB != null)
USB.Descriptors = null;
Id = id;
OptimalMultipleSectorsRead = optimalMultipleSectorsRead;
CanReadGdRomUsingSwapDisc = canReadGdRomUsingSwapDisc;
}
/// <summary>Optimal maximum number of transfer blocks to read</summary>
public int OptimalMultipleSectorsRead { get; set; }
/// <summary>Can read GD-ROM using disc swap trick?</summary>
public bool? CanReadGdRomUsingSwapDisc { get; set; }
/// <summary>Database ID</summary>
public new int Id { get; set; }
static TestedMedia ClearBinaries(TestedMedia media)
{
if(media is null)
return null;
media.AdipData = null;
media.AtipData = null;
media.BluBcaData = null;
media.BluDdsData = null;
media.BluDiData = null;
media.BluPacData = null;
media.BluSaiData = null;
media.C2PointersData = null;
media.CmiData = null;
media.CorrectedSubchannelData = null;
media.CorrectedSubchannelWithC2Data = null;
media.DcbData = null;
media.DmiData = null;
media.DvdAacsData = null;
media.DvdBcaData = null;
media.DvdDdsData = null;
media.DvdLayerData = null;
media.DvdSaiData = null;
media.EmbossedPfiData = null;
media.FullTocData = null;
media.HdCmiData = null;
media.HLDTSTReadRawDVDData = null;
media.IdentifyData = null;
media.LeadInData = null;
media.LeadOutData = null;
media.ModeSense6Data = null;
media.ModeSense10Data = null;
media.NecReadCddaData = null;
media.PfiData = null;
media.PioneerReadCddaData = null;
media.PioneerReadCddaMsfData = null;
media.PlextorReadCddaData = null;
media.PlextorReadRawDVDData = null;
media.PmaData = null;
media.PQSubchannelData = null;
media.PQSubchannelWithC2Data = null;
media.PriData = null;
media.Read6Data = null;
media.Read10Data = null;
media.Read12Data = null;
media.Read16Data = null;
media.ReadCdData = null;
media.ReadCdFullData = null;
media.ReadCdMsfData = null;
media.ReadCdMsfFullData = null;
media.ReadDmaData = null;
media.ReadDmaLba48Data = null;
media.ReadDmaLbaData = null;
media.ReadDmaRetryData = null;
media.ReadLba48Data = null;
media.ReadLbaData = null;
media.ReadLong10Data = null;
media.ReadLong16Data = null;
media.ReadLongData = null;
media.ReadLongLbaData = null;
media.ReadLongRetryData = null;
media.ReadLongRetryLbaData = null;
media.ReadRetryLbaData = null;
media.ReadSectorsData = null;
media.ReadSectorsRetryData = null;
media.RWSubchannelData = null;
media.RWSubchannelWithC2Data = null;
media.TocData = null;
media.Track1PregapData = null;
return media;
}
}

45
Aaru.Dto/NesHeaderDto.cs Normal file
View File

@@ -0,0 +1,45 @@
using Aaru.CommonTypes.Enums;
namespace Aaru.Dto;
/// <summary>DTO for iNES/NES 2.0 headers</summary>
public class NesHeaderDto
{
public int Id { get; set; }
/// <summary>ROM hash</summary>
public string Sha256 { get; set; }
/// <summary>If <c>true</c> vertical mirroring is hard-wired, horizontal or mapper defined otherwise</summary>
public bool NametableMirroring { get; set; }
/// <summary>If <c>true</c> a battery is present</summary>
public bool BatteryPresent { get; set; }
/// <summary>If <c>true</c> the four player screen mode is hardwired</summary>
public bool FourScreenMode { get; set; }
/// <summary>Mapper number (NES 2.0 when in conflict)</summary>
public ushort Mapper { get; set; }
/// <summary>Console type</summary>
public NesConsoleType ConsoleType { get; set; }
/// <summary>Submapper number</summary>
public byte Submapper { get; set; }
/// <summary>Timing mode</summary>
public NesTimingMode TimingMode { get; set; }
/// <summary>Vs. PPU type</summary>
public NesVsPpuType VsPpuType { get; set; }
/// <summary>Vs. hardware type</summary>
public NesVsHardwareType VsHardwareType { get; set; }
/// <summary>Extended console type</summary>
public NesExtendedConsoleType ExtendedConsoleType { get; set; }
/// <summary>Default expansion device</summary>
public NesDefaultExpansionDevice DefaultExpansionDevice { get; set; }
}

54
Aaru.Dto/SyncDto.cs Normal file
View File

@@ -0,0 +1,54 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : SyncDto.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// DTO for syncing server and client databases.
//
// --[ 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 <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2023 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
namespace Aaru.Dto;
/// <summary>DTO for database synchronization.</summary>
public class SyncDto
{
/// <summary>List of USB vendors</summary>
public List<UsbVendorDto> UsbVendors { get; set; }
/// <summary>List of USB products</summary>
public List<UsbProductDto> UsbProducts { get; set; }
/// <summary>List of CD read offsets</summary>
public List<CdOffsetDto> Offsets { get; set; }
/// <summary>List of known devices</summary>
public List<DeviceDto> Devices { get; set; }
/// <summary>List of known iNES/NES 2.0 headers</summary>
public List<NesHeaderDto> NesHeaders { get; set; }
}

52
Aaru.Dto/UsbProductDto.cs Normal file
View File

@@ -0,0 +1,52 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : UsbProductDto.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// DTO for syncing USB product identifiers in database.
//
// --[ 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 <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2023 Natalia Portillo
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
namespace Aaru.Dto;
/// <summary>DTO for USB product field</summary>
[SuppressMessage("ReSharper", "UnusedMember.Global")]
public class UsbProductDto
{
/// <summary>Database ID</summary>
public int Id { get; set; }
/// <summary>Product ID</summary>
public ushort ProductId { get; set; }
/// <summary>Product name</summary>
public string Product { get; set; }
/// <summary>Vendor ID</summary>
public ushort VendorId { get; set; }
}

43
Aaru.Dto/UsbVendorDto.cs Normal file
View File

@@ -0,0 +1,43 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : UsbVendorDto.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// DTO for syncing USB vendor identifiers in database.
//
// --[ 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 <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2023 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Dto;
/// <summary>DTO for USB vendor field</summary>
public class UsbVendorDto
{
/// <summary>Vendor ID</summary>
public ushort VendorId { get; set; }
/// <summary>Vendor</summary>
public string Vendor { get; set; }
}