mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add basic fields to device report.
This commit is contained in:
3
.idea/.idea.DiscImageChef/.idea/contentModel.xml
generated
3
.idea/.idea.DiscImageChef/.idea/contentModel.xml
generated
@@ -296,6 +296,8 @@
|
|||||||
<e p="Migrations" t="Include">
|
<e p="Migrations" t="Include">
|
||||||
<e p="20181126222301_DeviceReportV2.Designer.cs" t="Include" />
|
<e p="20181126222301_DeviceReportV2.Designer.cs" t="Include" />
|
||||||
<e p="20181126222301_DeviceReportV2.cs" t="Include" />
|
<e p="20181126222301_DeviceReportV2.cs" t="Include" />
|
||||||
|
<e p="20181127001622_AddDeviceBasicFields.Designer.cs" t="Include" />
|
||||||
|
<e p="20181127001622_AddDeviceBasicFields.cs" t="Include" />
|
||||||
<e p="DicContextModelSnapshot.cs" t="Include" />
|
<e p="DicContextModelSnapshot.cs" t="Include" />
|
||||||
</e>
|
</e>
|
||||||
<e p="Models" t="Include">
|
<e p="Models" t="Include">
|
||||||
@@ -1102,6 +1104,7 @@
|
|||||||
<e p="DiscImageChef.EntityFramework.csproj" t="IncludeRecursive" />
|
<e p="DiscImageChef.EntityFramework.csproj" t="IncludeRecursive" />
|
||||||
<e p="Program.cs" t="Include" />
|
<e p="Program.cs" t="Include" />
|
||||||
<e p="bin" t="ExcludeRecursive" />
|
<e p="bin" t="ExcludeRecursive" />
|
||||||
|
<e p="discimagechef.db" t="Include" />
|
||||||
<e p="obj" t="ExcludeRecursive">
|
<e p="obj" t="ExcludeRecursive">
|
||||||
<e p="Debug" t="Include">
|
<e p="Debug" t="Include">
|
||||||
<e p="netcoreapp2.1" t="Include">
|
<e p="netcoreapp2.1" t="Include">
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using DiscImageChef.CommonTypes.Enums;
|
||||||
using DiscImageChef.Decoders.ATA;
|
using DiscImageChef.Decoders.ATA;
|
||||||
using DiscImageChef.Decoders.SCSI;
|
using DiscImageChef.Decoders.SCSI;
|
||||||
using DiscImageChef.Decoders.SCSI.MMC;
|
using DiscImageChef.Decoders.SCSI.MMC;
|
||||||
@@ -61,6 +62,11 @@ namespace DiscImageChef.CommonTypes.Metadata
|
|||||||
public Scsi SCSI { get; set; }
|
public Scsi SCSI { get; set; }
|
||||||
public MmcSd MultiMediaCard { get; set; }
|
public MmcSd MultiMediaCard { get; set; }
|
||||||
public MmcSd SecureDigital { get; set; }
|
public MmcSd SecureDigital { get; set; }
|
||||||
|
|
||||||
|
public string Manufacturer { get; set; }
|
||||||
|
public string Model { get; set; }
|
||||||
|
public string Revision { get; set; }
|
||||||
|
public DeviceType Type { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Usb
|
public class Usb
|
||||||
|
|||||||
1182
DiscImageChef.Database/Migrations/20181127001622_AddDeviceBasicFields.Designer.cs
generated
Normal file
1182
DiscImageChef.Database/Migrations/20181127001622_AddDeviceBasicFields.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,50 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Database.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddDeviceBasicFields : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Manufacturer",
|
||||||
|
table: "Reports",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Model",
|
||||||
|
table: "Reports",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Revision",
|
||||||
|
table: "Reports",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Type",
|
||||||
|
table: "Reports",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Manufacturer",
|
||||||
|
table: "Reports");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Model",
|
||||||
|
table: "Reports");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Revision",
|
||||||
|
table: "Reports");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Type",
|
||||||
|
table: "Reports");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -90,14 +90,22 @@ namespace DiscImageChef.Database.Migrations
|
|||||||
|
|
||||||
b.Property<int?>("FireWireId");
|
b.Property<int?>("FireWireId");
|
||||||
|
|
||||||
|
b.Property<string>("Manufacturer");
|
||||||
|
|
||||||
|
b.Property<string>("Model");
|
||||||
|
|
||||||
b.Property<int?>("MultiMediaCardId");
|
b.Property<int?>("MultiMediaCardId");
|
||||||
|
|
||||||
b.Property<int?>("PCMCIAId");
|
b.Property<int?>("PCMCIAId");
|
||||||
|
|
||||||
|
b.Property<string>("Revision");
|
||||||
|
|
||||||
b.Property<int?>("SCSIId");
|
b.Property<int?>("SCSIId");
|
||||||
|
|
||||||
b.Property<int?>("SecureDigitalId");
|
b.Property<int?>("SecureDigitalId");
|
||||||
|
|
||||||
|
b.Property<int>("Type");
|
||||||
|
|
||||||
b.Property<int?>("USBId");
|
b.Property<int?>("USBId");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ namespace DiscImageChef.Database.Models
|
|||||||
{
|
{
|
||||||
public class Device : DeviceReportV2
|
public class Device : DeviceReportV2
|
||||||
{
|
{
|
||||||
|
public Device()
|
||||||
|
{
|
||||||
|
LastSynchronized = DateTime.UtcNow;
|
||||||
|
}
|
||||||
|
|
||||||
public Device(DeviceReportV2 report)
|
public Device(DeviceReportV2 report)
|
||||||
{
|
{
|
||||||
ATA = report.ATA;
|
ATA = report.ATA;
|
||||||
@@ -17,6 +22,10 @@ namespace DiscImageChef.Database.Models
|
|||||||
SCSI = report.SCSI;
|
SCSI = report.SCSI;
|
||||||
SecureDigital = report.SecureDigital;
|
SecureDigital = report.SecureDigital;
|
||||||
USB = report.USB;
|
USB = report.USB;
|
||||||
|
Manufacturer = report.Manufacturer;
|
||||||
|
Model = report.Model;
|
||||||
|
Revision = report.Revision;
|
||||||
|
Type = report.Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTime LastSynchronized { get; set; }
|
public DateTime LastSynchronized { get; set; }
|
||||||
|
|||||||
@@ -5,6 +5,12 @@ namespace DiscImageChef.Database.Models
|
|||||||
{
|
{
|
||||||
public class Report : DeviceReportV2
|
public class Report : DeviceReportV2
|
||||||
{
|
{
|
||||||
|
public Report()
|
||||||
|
{
|
||||||
|
Created = DateTime.UtcNow;
|
||||||
|
Uploaded = false;
|
||||||
|
}
|
||||||
|
|
||||||
public Report(DeviceReportV2 report)
|
public Report(DeviceReportV2 report)
|
||||||
{
|
{
|
||||||
ATA = report.ATA;
|
ATA = report.ATA;
|
||||||
@@ -18,6 +24,10 @@ namespace DiscImageChef.Database.Models
|
|||||||
SecureDigital = report.SecureDigital;
|
SecureDigital = report.SecureDigital;
|
||||||
USB = report.USB;
|
USB = report.USB;
|
||||||
Uploaded = false;
|
Uploaded = false;
|
||||||
|
Manufacturer = report.Manufacturer;
|
||||||
|
Model = report.Model;
|
||||||
|
Revision = report.Revision;
|
||||||
|
Type = report.Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTime Created { get; set; }
|
public DateTime Created { get; set; }
|
||||||
|
|||||||
@@ -67,9 +67,12 @@ namespace DiscImageChef.Commands
|
|||||||
|
|
||||||
Core.Statistics.AddDevice(dev);
|
Core.Statistics.AddDevice(dev);
|
||||||
|
|
||||||
DeviceReportV2 report = new DeviceReportV2();
|
DeviceReportV2 report = new DeviceReportV2
|
||||||
bool removable = false;
|
{
|
||||||
string jsonFile;
|
Manufacturer = dev.Manufacturer, Model = dev.Model, Revision = dev.Revision, Type = dev.Type
|
||||||
|
};
|
||||||
|
bool removable = false;
|
||||||
|
string jsonFile;
|
||||||
|
|
||||||
if(!string.IsNullOrWhiteSpace(dev.Manufacturer) && !string.IsNullOrWhiteSpace(dev.Revision))
|
if(!string.IsNullOrWhiteSpace(dev.Manufacturer) && !string.IsNullOrWhiteSpace(dev.Revision))
|
||||||
jsonFile = dev.Manufacturer + "_" + dev.Model + "_" + dev.Revision + ".json";
|
jsonFile = dev.Manufacturer + "_" + dev.Model + "_" + dev.Revision + ".json";
|
||||||
|
|||||||
Reference in New Issue
Block a user