mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Move database context, migrations and models to separate project.
This commit is contained in:
9
Aaru.Server.Database/Models/BaseModel.cs
Normal file
9
Aaru.Server.Database/Models/BaseModel.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public abstract class BaseModel<T>
|
||||
{
|
||||
[Key]
|
||||
public T Id { get; set; }
|
||||
}
|
||||
40
Aaru.Server.Database/Models/BaseOperatingSystem.cs
Normal file
40
Aaru.Server.Database/Models/BaseOperatingSystem.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : OperatingSystem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing operating system statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public abstract class BaseOperatingSystem : BaseModel<int>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Version { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
71
Aaru.Server.Database/Models/CdOffset.cs
Normal file
71
Aaru.Server.Database/Models/CdOffset.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : CdOffset.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing Compact Disc read offsets 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel;
|
||||
using Aaru.CommonTypes.Metadata;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class CompactDiscOffset : CdOffset
|
||||
{
|
||||
public CompactDiscOffset() {}
|
||||
|
||||
public CompactDiscOffset(string manufacturer, string model, short offset, int submissions, float agreement)
|
||||
{
|
||||
Manufacturer = manufacturer;
|
||||
Model = model;
|
||||
Offset = offset;
|
||||
Submissions = submissions;
|
||||
Agreement = agreement;
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public CompactDiscOffset(CdOffset offset)
|
||||
{
|
||||
Manufacturer = offset.Manufacturer;
|
||||
Model = offset.Model;
|
||||
Offset = offset.Offset;
|
||||
Submissions = offset.Submissions;
|
||||
Agreement = offset.Agreement;
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
[DisplayName("Added date")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[DisplayName("Modification date")]
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
|
||||
public virtual ICollection<Device> Devices { get; set; }
|
||||
}
|
||||
14
Aaru.Server.Database/Models/ChsModel.cs
Normal file
14
Aaru.Server.Database/Models/ChsModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class ChsModel
|
||||
{
|
||||
public ushort Cylinders { get; set; }
|
||||
public ushort Heads { get; set; }
|
||||
public ushort Sectors { get; set; }
|
||||
}
|
||||
|
||||
public class ChsModelForView
|
||||
{
|
||||
public List<ChsModel> List { get; set; }
|
||||
public string Json { get; set; }
|
||||
}
|
||||
35
Aaru.Server.Database/Models/Command.cs
Normal file
35
Aaru.Server.Database/Models/Command.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Command.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing command statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class Command : NameCountModel<int> {}
|
||||
13
Aaru.Server.Database/Models/CompareModel.cs
Normal file
13
Aaru.Server.Database/Models/CompareModel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class CompareModel
|
||||
{
|
||||
public int LeftId { get; set; }
|
||||
public int RightId { get; set; }
|
||||
public List<string> ValueNames { get; set; }
|
||||
public List<string> LeftValues { get; set; }
|
||||
public List<string> RightValues { get; set; }
|
||||
public bool HasError { get; set; }
|
||||
public string ErrorMessage { get; set; }
|
||||
public bool AreEqual { get; set; }
|
||||
}
|
||||
110
Aaru.Server.Database/Models/Device.cs
Normal file
110
Aaru.Server.Database/Models/Device.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Device.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Metadata;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class Device : DeviceReportV2
|
||||
{
|
||||
public Device() => AddedWhen = DateTime.UtcNow;
|
||||
|
||||
public Device(DeviceReportV2 report)
|
||||
{
|
||||
ATA = report.ATA;
|
||||
ATAPI = report.ATAPI;
|
||||
CompactFlash = report.CompactFlash;
|
||||
FireWire = report.FireWire;
|
||||
AddedWhen = DateTime.UtcNow;
|
||||
ModifiedWhen = DateTime.UtcNow;
|
||||
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;
|
||||
}
|
||||
|
||||
public Device(int? ataId, int? atapiId, int? firewireId, int? multimediacardId, int? pcmciaId, int? securedigitalId,
|
||||
int? scsiId, int? usbId, DateTime uploadedWhen, string manufacturer, string model, string revision,
|
||||
bool compactFlash, DeviceType type, int? gdRomSwapDiscCapabilitiesId)
|
||||
{
|
||||
ATAId = ataId;
|
||||
ATAPIId = atapiId;
|
||||
FireWireId = firewireId;
|
||||
MultiMediaCardId = multimediacardId;
|
||||
PCMCIAId = pcmciaId;
|
||||
SecureDigitalId = securedigitalId;
|
||||
SCSIId = scsiId;
|
||||
USBId = usbId;
|
||||
AddedWhen = uploadedWhen;
|
||||
ModifiedWhen = DateTime.UtcNow;
|
||||
Manufacturer = manufacturer;
|
||||
Model = model;
|
||||
Revision = revision;
|
||||
CompactFlash = compactFlash;
|
||||
Type = type;
|
||||
GdRomSwapDiscCapabilitiesId = gdRomSwapDiscCapabilitiesId;
|
||||
}
|
||||
|
||||
[DisplayName("Added when")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[DisplayName("Modified when")]
|
||||
public DateTime? ModifiedWhen { get; set; }
|
||||
|
||||
public virtual CompactDiscOffset CdOffset { get; set; }
|
||||
|
||||
[DefaultValue(0)]
|
||||
[DisplayName("Optimal no. of sectors to be read at once")]
|
||||
public int OptimalMultipleSectorsRead { get; set; }
|
||||
|
||||
[DefaultValue(null)]
|
||||
[DisplayName("Can read GD-ROM using swap disc trick")]
|
||||
public bool? CanReadGdRomUsingSwapDisc { get; set; }
|
||||
|
||||
public int? ATAId { get; set; }
|
||||
public int? ATAPIId { get; set; }
|
||||
public int? FireWireId { get; set; }
|
||||
public int? MultiMediaCardId { get; set; }
|
||||
public int? PCMCIAId { get; set; }
|
||||
public int? SecureDigitalId { get; set; }
|
||||
public int? SCSIId { get; set; }
|
||||
public int? USBId { get; set; }
|
||||
public int? GdRomSwapDiscCapabilitiesId { get; set; }
|
||||
}
|
||||
17
Aaru.Server.Database/Models/DeviceDetails.cs
Normal file
17
Aaru.Server.Database/Models/DeviceDetails.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Aaru.CommonTypes.Metadata;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class DeviceDetails
|
||||
{
|
||||
public Device Report { get; set; }
|
||||
public List<int> SameAll { get; set; }
|
||||
public List<int> SameButManufacturer { get; set; }
|
||||
public List<int> ReportAll { get; set; }
|
||||
public List<int> ReportButManufacturer { get; set; }
|
||||
public List<DeviceStat> StatsAll { get; set; }
|
||||
public List<DeviceStat> StatsButManufacturer { get; set; }
|
||||
public int ReadCapabilitiesId { get; set; }
|
||||
public List<TestedMedia> TestedMedias { get; set; }
|
||||
public List<TestedSequentialMedia> TestedSequentialMedias { get; set; }
|
||||
}
|
||||
42
Aaru.Server.Database/Models/DeviceItem.cs
Normal file
42
Aaru.Server.Database/Models/DeviceItem.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : DeviceItem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for showing device statistics.
|
||||
//
|
||||
// --[ 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class DeviceItem
|
||||
{
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Revision { get; set; }
|
||||
public string Bus { get; set; }
|
||||
public int ReportId { get; set; }
|
||||
}
|
||||
42
Aaru.Server.Database/Models/DeviceStat.cs
Normal file
42
Aaru.Server.Database/Models/DeviceStat.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : DeviceStat.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing device statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class DeviceStat : BaseModel<int>
|
||||
{
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Revision { get; set; }
|
||||
public string Bus { get; set; }
|
||||
public virtual Device Report { get; set; }
|
||||
}
|
||||
8
Aaru.Server.Database/Models/ErrorViewModel.cs
Normal file
8
Aaru.Server.Database/Models/ErrorViewModel.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
35
Aaru.Server.Database/Models/Filesystem.cs
Normal file
35
Aaru.Server.Database/Models/Filesystem.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Filesystem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing filesystem statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class Filesystem : NameCountModel<int> {}
|
||||
35
Aaru.Server.Database/Models/Filter.cs
Normal file
35
Aaru.Server.Database/Models/Filter.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Filter.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing filter statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class Filter : NameCountModel<int> {}
|
||||
10
Aaru.Server.Database/Models/FindReportModel.cs
Normal file
10
Aaru.Server.Database/Models/FindReportModel.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class FindReportModel : BaseModel<int>
|
||||
{
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Revision { get; set; }
|
||||
public string Bus { get; set; }
|
||||
public List<Device> LikeDevices { get; set; }
|
||||
}
|
||||
30
Aaru.Server.Database/Models/FireWireModel.cs
Normal file
30
Aaru.Server.Database/Models/FireWireModel.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class FireWireModel
|
||||
{
|
||||
[DisplayName("Vendor ID")]
|
||||
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "0x{0:X8}")]
|
||||
public uint VendorID { get; set; }
|
||||
|
||||
[DisplayName("Product ID")]
|
||||
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "0x{0:X8}")]
|
||||
public uint ProductID { get; set; }
|
||||
|
||||
[DisplayFormat(NullDisplayText = "Unknown")]
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
[DisplayFormat(NullDisplayText = "Unknown")]
|
||||
public string Product { get; set; }
|
||||
|
||||
[DisplayName("Is media removable?")]
|
||||
public bool RemovableMedia { get; set; }
|
||||
}
|
||||
|
||||
public class FireWireModelForView
|
||||
{
|
||||
public List<FireWireModel> List { get; set; }
|
||||
public string Json { get; set; }
|
||||
}
|
||||
14
Aaru.Server.Database/Models/IdHashModel.cs
Normal file
14
Aaru.Server.Database/Models/IdHashModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class IdHashModel : BaseModel<int>
|
||||
{
|
||||
public IdHashModel(int id, string hash)
|
||||
{
|
||||
Id = id;
|
||||
Hash = hash;
|
||||
}
|
||||
|
||||
public string Hash { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int[] Duplicates { get; set; }
|
||||
}
|
||||
7
Aaru.Server.Database/Models/IdHashModelForView.cs
Normal file
7
Aaru.Server.Database/Models/IdHashModelForView.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class IdHashModelForView
|
||||
{
|
||||
public List<IdHashModel> List { get; set; }
|
||||
public string Json { get; set; }
|
||||
}
|
||||
78
Aaru.Server.Database/Models/Media.cs
Normal file
78
Aaru.Server.Database/Models/Media.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Media.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing media type statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Aaru.CommonTypes;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class Media : BaseModel<int>
|
||||
{
|
||||
[NotMapped]
|
||||
(string type, string subType) _mediaType;
|
||||
|
||||
public string Type { get; set; }
|
||||
public bool Real { get; set; }
|
||||
public long Count { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
(string type, string subType) MediaType
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_mediaType != default((string type, string subType))) return _mediaType;
|
||||
|
||||
try
|
||||
{
|
||||
if(Enum.TryParse(Type, out MediaType enumMediaType))
|
||||
_mediaType = CommonTypes.Metadata.MediaType.MediaTypeToString(enumMediaType);
|
||||
else if(int.TryParse(Type, out int asInt))
|
||||
_mediaType = CommonTypes.Metadata.MediaType.MediaTypeToString((MediaType)asInt);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Could not get media type/subtype pair from type, so just leave it as is
|
||||
}
|
||||
|
||||
return _mediaType;
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
[DisplayName("Physical type")]
|
||||
public string PhysicalType => MediaType.type;
|
||||
|
||||
[NotMapped]
|
||||
[DisplayName("Logical type")]
|
||||
public string LogicalType => MediaType.subType;
|
||||
}
|
||||
35
Aaru.Server.Database/Models/MediaFormat.cs
Normal file
35
Aaru.Server.Database/Models/MediaFormat.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : MediaFormat.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing media image format statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class MediaFormat : NameCountModel<int> {}
|
||||
40
Aaru.Server.Database/Models/MediaItem.cs
Normal file
40
Aaru.Server.Database/Models/MediaItem.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : MediaItem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for showing media type statistics.
|
||||
//
|
||||
// --[ 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class MediaItem
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string SubType { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
14
Aaru.Server.Database/Models/MmcModelForView.cs
Normal file
14
Aaru.Server.Database/Models/MmcModelForView.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class MmcModelForView : BaseModel<int>
|
||||
{
|
||||
[DisplayFormat(NullDisplayText = "none")]
|
||||
[DisplayName("MMC FEATURES ID")]
|
||||
public int? FeaturesId { get; set; }
|
||||
|
||||
[DisplayName("Response length (bytes)")]
|
||||
public int DataLength { get; set; }
|
||||
}
|
||||
7
Aaru.Server.Database/Models/NameCountModel.cs
Normal file
7
Aaru.Server.Database/Models/NameCountModel.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public abstract class NameCountModel<T> : BaseModel<T>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
51
Aaru.Server.Database/Models/NesHeaderInfo.cs
Normal file
51
Aaru.Server.Database/Models/NesHeaderInfo.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class NesHeaderInfo : BaseModel<int>
|
||||
{
|
||||
/// <summary>ROM hash</summary>
|
||||
[StringLength(64)]
|
||||
[Required]
|
||||
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; }
|
||||
|
||||
/// <summary>Date when model has been added to the database</summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
/// <summary>Date when model was last modified</summary>
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
}
|
||||
35
Aaru.Server.Database/Models/OperatingSystem.cs
Normal file
35
Aaru.Server.Database/Models/OperatingSystem.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : OperatingSystem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing operating system statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class OperatingSystem : BaseOperatingSystem {}
|
||||
35
Aaru.Server.Database/Models/Partition.cs
Normal file
35
Aaru.Server.Database/Models/Partition.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Partition.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing partition statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class Partition : NameCountModel<int> {}
|
||||
35
Aaru.Server.Database/Models/RemoteApplication.cs
Normal file
35
Aaru.Server.Database/Models/RemoteApplication.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : RemoteApplication.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing remote application statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class RemoteApplication : BaseOperatingSystem {}
|
||||
35
Aaru.Server.Database/Models/RemoteArchitecture.cs
Normal file
35
Aaru.Server.Database/Models/RemoteArchitecture.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : RemoteArchitecture.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing remote architecture statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class RemoteArchitecture : NameCountModel<int> {}
|
||||
35
Aaru.Server.Database/Models/RemoteOperatingSystem.cs
Normal file
35
Aaru.Server.Database/Models/RemoteOperatingSystem.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : RemoteOperatingSystem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing remote operating system statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class RemoteOperatingSystem : BaseOperatingSystem {}
|
||||
14
Aaru.Server.Database/Models/SscModel.cs
Normal file
14
Aaru.Server.Database/Models/SscModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class SscModel
|
||||
{
|
||||
public byte? BlockSizeGranularity { get; set; }
|
||||
public uint? MaxBlockLength { get; set; }
|
||||
public uint? MinBlockLength { get; set; }
|
||||
}
|
||||
|
||||
public class SscModelForView
|
||||
{
|
||||
public List<SscModel> List { get; set; }
|
||||
public string Json { get; set; }
|
||||
}
|
||||
9
Aaru.Server.Database/Models/TestedMediaDataModel.cs
Normal file
9
Aaru.Server.Database/Models/TestedMediaDataModel.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class TestedMediaDataModel
|
||||
{
|
||||
public int TestedMediaId { get; set; }
|
||||
public string DataName { get; set; }
|
||||
public string RawDataAsHex { get; set; }
|
||||
public string Decoded { get; set; }
|
||||
}
|
||||
73
Aaru.Server.Database/Models/UploadedReport.cs
Normal file
73
Aaru.Server.Database/Models/UploadedReport.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UploadedReport.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing uploaded 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel;
|
||||
using Aaru.CommonTypes.Metadata;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class UploadedReport : DeviceReportV2
|
||||
{
|
||||
public UploadedReport() => UploadedWhen = DateTime.UtcNow;
|
||||
|
||||
public UploadedReport(DeviceReportV2 report)
|
||||
{
|
||||
ATA = report.ATA;
|
||||
ATAPI = report.ATAPI;
|
||||
CompactFlash = report.CompactFlash;
|
||||
FireWire = report.FireWire;
|
||||
UploadedWhen = DateTime.UtcNow;
|
||||
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;
|
||||
}
|
||||
|
||||
[DisplayName("Uploaded when")]
|
||||
public DateTime UploadedWhen { get; set; }
|
||||
|
||||
public int? ATAId { get; set; }
|
||||
public int? ATAPIId { get; set; }
|
||||
public int? FireWireId { get; set; }
|
||||
public int? MultiMediaCardId { get; set; }
|
||||
public int? PCMCIAId { get; set; }
|
||||
public int? SecureDigitalId { get; set; }
|
||||
public int? SCSIId { get; set; }
|
||||
public int? USBId { get; set; }
|
||||
public int? GdRomSwapDiscCapabilitiesId { get; set; }
|
||||
}
|
||||
15
Aaru.Server.Database/Models/UploadedReportDetails.cs
Normal file
15
Aaru.Server.Database/Models/UploadedReportDetails.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Aaru.CommonTypes.Metadata;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class UploadedReportDetails
|
||||
{
|
||||
public UploadedReport Report { get; set; }
|
||||
public List<int> SameAll { get; set; }
|
||||
public List<int> SameButManufacturer { get; set; }
|
||||
public List<int> ReportAll { get; set; }
|
||||
public List<int> ReportButManufacturer { get; set; }
|
||||
public int ReadCapabilitiesId { get; set; }
|
||||
public List<TestedMedia> TestedMedias { get; set; }
|
||||
public List<TestedSequentialMedia> TestedSequentialMedias { get; set; }
|
||||
}
|
||||
15
Aaru.Server.Database/Models/UsbModel.cs
Normal file
15
Aaru.Server.Database/Models/UsbModel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class UsbModel
|
||||
{
|
||||
public string Manufacturer { get; set; }
|
||||
public string Product { get; set; }
|
||||
public ushort VendorID { get; set; }
|
||||
public ushort ProductID { get; set; }
|
||||
}
|
||||
|
||||
public class UsbModelForView
|
||||
{
|
||||
public List<UsbModel> List { get; set; }
|
||||
public string Json { get; set; }
|
||||
}
|
||||
57
Aaru.Server.Database/Models/UsbProduct.cs
Normal file
57
Aaru.Server.Database/Models/UsbProduct.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UsbProduct.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class UsbProduct : BaseModel<int>
|
||||
{
|
||||
public UsbProduct() {}
|
||||
|
||||
public UsbProduct(UsbVendor vendor, ushort id, string product)
|
||||
{
|
||||
ProductId = id;
|
||||
Product = product;
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
Vendor = vendor;
|
||||
}
|
||||
|
||||
public ushort ProductId { get; set; }
|
||||
public string Product { get; set; }
|
||||
public DateTime AddedWhen { get; set; }
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
public int VendorId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual UsbVendor Vendor { get; set; }
|
||||
}
|
||||
19
Aaru.Server.Database/Models/UsbProductModel.cs
Normal file
19
Aaru.Server.Database/Models/UsbProductModel.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class UsbProductModel
|
||||
{
|
||||
[DisplayName("Manufacturer")]
|
||||
public string VendorName { get; set; }
|
||||
|
||||
public int VendorId { get; set; }
|
||||
|
||||
[DisplayName("Product")]
|
||||
public string ProductName { get; set; }
|
||||
|
||||
[DisplayName("Product ID")]
|
||||
[DisplayFormat(DataFormatString = "0x{0:X4}")]
|
||||
public ushort ProductId { get; set; }
|
||||
}
|
||||
62
Aaru.Server.Database/Models/UsbVendor.cs
Normal file
62
Aaru.Server.Database/Models/UsbVendor.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UsbVendor.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class UsbVendor : BaseModel<int>
|
||||
{
|
||||
public UsbVendor() {}
|
||||
|
||||
public UsbVendor(ushort id, string vendor)
|
||||
{
|
||||
VendorId = id;
|
||||
Vendor = vendor;
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
[DisplayName("Manufacturer ID")]
|
||||
[DisplayFormat(DataFormatString = "0x{0:X4}")]
|
||||
public ushort VendorId { get; set; }
|
||||
|
||||
[DisplayName("Manufacturer")]
|
||||
public string Vendor { get; set; }
|
||||
|
||||
public DateTime AddedWhen { get; set; }
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<UsbProduct> Products { get; set; }
|
||||
}
|
||||
16
Aaru.Server.Database/Models/UsbVendorModel.cs
Normal file
16
Aaru.Server.Database/Models/UsbVendorModel.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class UsbVendorModel
|
||||
{
|
||||
[DisplayName("Manufacturer")]
|
||||
public string Vendor { get; set; }
|
||||
|
||||
[DisplayName("Vendor ID")]
|
||||
[DisplayFormat(DataFormatString = "0x{0:X4}")]
|
||||
public ushort VendorId { get; set; }
|
||||
|
||||
public List<UsbProductModel> Products { get; set; }
|
||||
}
|
||||
35
Aaru.Server.Database/Models/Version.cs
Normal file
35
Aaru.Server.Database/Models/Version.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Version.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing version statistics 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-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Server.Database.Models;
|
||||
|
||||
public class Version : NameCountModel<int> {}
|
||||
Reference in New Issue
Block a user