mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move NameValue statistics to database.
This commit is contained in:
8
.idea/.idea.DiscImageChef/.idea/contentModel.xml
generated
8
.idea/.idea.DiscImageChef/.idea/contentModel.xml
generated
@@ -57,6 +57,7 @@
|
||||
<e p="Settings.StyleCop" t="Include" />
|
||||
<e p="StyleCop.Cache" t="Include" />
|
||||
<e p="bin" t="ExcludeRecursive" />
|
||||
<e p="discimagechef.db" t="Include" />
|
||||
<e p="obj" t="ExcludeRecursive">
|
||||
<e p="Debug" t="Include">
|
||||
<e p="net461" t="Include">
|
||||
@@ -302,10 +303,17 @@
|
||||
<e p="20181127001622_AddDeviceBasicFields.cs" t="Include" />
|
||||
<e p="20181127013131_CorrectReportsDbSet.Designer.cs" t="Include" />
|
||||
<e p="20181127013131_CorrectReportsDbSet.cs" t="Include" />
|
||||
<e p="20181221015906_NameValueStatistics.Designer.cs" t="Include" />
|
||||
<e p="20181221015906_NameValueStatistics.cs" t="Include" />
|
||||
<e p="DicContextModelSnapshot.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Models" t="Include">
|
||||
<e p="Command.cs" t="Include" />
|
||||
<e p="Device.cs" t="Include" />
|
||||
<e p="Filesystem.cs" t="Include" />
|
||||
<e p="Filter.cs" t="Include" />
|
||||
<e p="MediaFormat.cs" t="Include" />
|
||||
<e p="Partition.cs" t="Include" />
|
||||
<e p="Report.cs" t="Include" />
|
||||
</e>
|
||||
<e p="bin" t="ExcludeRecursive" />
|
||||
|
||||
@@ -110,6 +110,7 @@
|
||||
<Project>{ccaa7afe-c094-4d82-a66d-630de8a3f545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DiscImageChef.Database\DiscImageChef.Database.csproj" />
|
||||
<ProjectReference Include="..\DiscImageChef.Filesystems\DiscImageChef.Filesystems.csproj">
|
||||
<Project>{D7016DF2-5A5E-4524-B40D-BA2D59576688}</Project>
|
||||
<Name>DiscImageChef.Filesystems</Name>
|
||||
|
||||
@@ -39,7 +39,9 @@ using System.Threading;
|
||||
using System.Xml.Serialization;
|
||||
using DiscImageChef.CommonTypes.Interop;
|
||||
using DiscImageChef.CommonTypes.Metadata;
|
||||
using DiscImageChef.Devices;
|
||||
using DiscImageChef.Database;
|
||||
using DiscImageChef.Database.Models;
|
||||
using Device = DiscImageChef.Devices.Device;
|
||||
using MediaType = DiscImageChef.CommonTypes.MediaType;
|
||||
using Version = DiscImageChef.CommonTypes.Interop.Version;
|
||||
|
||||
@@ -63,6 +65,8 @@ namespace DiscImageChef.Core
|
||||
/// </summary>
|
||||
static bool submitStatsLock;
|
||||
|
||||
static DicContext ctx = new DicContext();
|
||||
|
||||
/// <summary>
|
||||
/// Loads saved statistics from disk
|
||||
/// </summary>
|
||||
@@ -126,6 +130,8 @@ namespace DiscImageChef.Core
|
||||
/// </summary>
|
||||
public static void SaveStats()
|
||||
{
|
||||
ctx.SaveChanges();
|
||||
|
||||
if(AllStats == null) return;
|
||||
|
||||
if(AllStats.OperatingSystems != null)
|
||||
@@ -275,99 +281,11 @@ namespace DiscImageChef.Core
|
||||
/// <param name="command">Command</param>
|
||||
public static void AddCommand(string command)
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(command)) return;
|
||||
|
||||
if(Settings.Settings.Current.Stats == null || !Settings.Settings.Current.Stats.DeviceStats) return;
|
||||
|
||||
if(AllStats.Commands == null) AllStats.Commands = new CommandsStats();
|
||||
|
||||
if(CurrentStats.Commands == null) CurrentStats.Commands = new CommandsStats();
|
||||
|
||||
switch(command)
|
||||
{
|
||||
case "analyze":
|
||||
AllStats.Commands.Analyze++;
|
||||
CurrentStats.Commands.Analyze++;
|
||||
break;
|
||||
case "benchmark":
|
||||
AllStats.Commands.Benchmark++;
|
||||
CurrentStats.Commands.Benchmark++;
|
||||
break;
|
||||
case "checksum":
|
||||
AllStats.Commands.Checksum++;
|
||||
CurrentStats.Commands.Checksum++;
|
||||
break;
|
||||
case "compare":
|
||||
AllStats.Commands.Compare++;
|
||||
CurrentStats.Commands.Compare++;
|
||||
break;
|
||||
case "create-sidecar":
|
||||
AllStats.Commands.CreateSidecar++;
|
||||
CurrentStats.Commands.CreateSidecar++;
|
||||
break;
|
||||
case "decode":
|
||||
AllStats.Commands.Decode++;
|
||||
CurrentStats.Commands.Decode++;
|
||||
break;
|
||||
case "device-info":
|
||||
AllStats.Commands.DeviceInfo++;
|
||||
CurrentStats.Commands.DeviceInfo++;
|
||||
break;
|
||||
case "device-report":
|
||||
AllStats.Commands.DeviceReport++;
|
||||
CurrentStats.Commands.DeviceReport++;
|
||||
break;
|
||||
case "dump-media":
|
||||
AllStats.Commands.DumpMedia++;
|
||||
CurrentStats.Commands.DumpMedia++;
|
||||
break;
|
||||
case "entropy":
|
||||
AllStats.Commands.Entropy++;
|
||||
CurrentStats.Commands.Entropy++;
|
||||
break;
|
||||
case "extract-files":
|
||||
AllStats.Commands.ExtractFiles++;
|
||||
CurrentStats.Commands.ExtractFiles++;
|
||||
break;
|
||||
case "formats":
|
||||
AllStats.Commands.Formats++;
|
||||
CurrentStats.Commands.Formats++;
|
||||
break;
|
||||
case "ls":
|
||||
AllStats.Commands.Ls++;
|
||||
CurrentStats.Commands.Ls++;
|
||||
break;
|
||||
case "media-info":
|
||||
AllStats.Commands.MediaInfo++;
|
||||
CurrentStats.Commands.MediaInfo++;
|
||||
break;
|
||||
case "media-scan":
|
||||
AllStats.Commands.MediaScan++;
|
||||
CurrentStats.Commands.MediaScan++;
|
||||
break;
|
||||
case "print-hex":
|
||||
AllStats.Commands.PrintHex++;
|
||||
CurrentStats.Commands.PrintHex++;
|
||||
break;
|
||||
case "verify":
|
||||
AllStats.Commands.Verify++;
|
||||
CurrentStats.Commands.Verify++;
|
||||
break;
|
||||
case "list-devices":
|
||||
AllStats.Commands.ListDevices++;
|
||||
CurrentStats.Commands.ListDevices++;
|
||||
break;
|
||||
case "list-encodings":
|
||||
AllStats.Commands.ListEncodings++;
|
||||
CurrentStats.Commands.ListEncodings++;
|
||||
break;
|
||||
case "convert-image":
|
||||
AllStats.Commands.ConvertImage++;
|
||||
CurrentStats.Commands.ConvertImage++;
|
||||
break;
|
||||
case "image-info":
|
||||
AllStats.Commands.ImageInfo++;
|
||||
CurrentStats.Commands.ImageInfo++;
|
||||
break;
|
||||
}
|
||||
ctx.Commands.Add(new Command {Name = command, Synchronized = false});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -376,44 +294,11 @@ namespace DiscImageChef.Core
|
||||
/// <param name="filesystem">Filesystem name</param>
|
||||
public static void AddFilesystem(string filesystem)
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(filesystem)) return;
|
||||
|
||||
if(Settings.Settings.Current.Stats == null || !Settings.Settings.Current.Stats.FilesystemStats) return;
|
||||
|
||||
if(AllStats.Filesystems == null) AllStats.Filesystems = new List<NameValueStats>();
|
||||
if(CurrentStats.Filesystems == null) CurrentStats.Filesystems = new List<NameValueStats>();
|
||||
|
||||
NameValueStats old = AllStats.Filesystems.FirstOrDefault(nvs => nvs.name == filesystem);
|
||||
|
||||
NameValueStats nw = new NameValueStats();
|
||||
if(old != null)
|
||||
{
|
||||
nw.name = old.name;
|
||||
nw.Value = old.Value + 1;
|
||||
AllStats.Filesystems.Remove(old);
|
||||
}
|
||||
else
|
||||
{
|
||||
nw.name = filesystem;
|
||||
nw.Value = 1;
|
||||
}
|
||||
|
||||
AllStats.Filesystems.Add(nw);
|
||||
|
||||
old = CurrentStats.Filesystems.FirstOrDefault(nvs => nvs.name == filesystem);
|
||||
|
||||
nw = new NameValueStats();
|
||||
if(old != null)
|
||||
{
|
||||
nw.name = old.name;
|
||||
nw.Value = old.Value + 1;
|
||||
CurrentStats.Filesystems.Remove(old);
|
||||
}
|
||||
else
|
||||
{
|
||||
nw.name = filesystem;
|
||||
nw.Value = 1;
|
||||
}
|
||||
|
||||
CurrentStats.Filesystems.Add(nw);
|
||||
ctx.Filesystems.Add(new Filesystem {Name = filesystem, Synchronized = false});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -422,58 +307,29 @@ namespace DiscImageChef.Core
|
||||
/// <param name="partition">Partition scheme name</param>
|
||||
internal static void AddPartition(string partition)
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(partition)) return;
|
||||
|
||||
if(Settings.Settings.Current.Stats == null || !Settings.Settings.Current.Stats.PartitionStats) return;
|
||||
|
||||
if(AllStats.Partitions == null) AllStats.Partitions = new List<NameValueStats>();
|
||||
if(CurrentStats.Partitions == null) CurrentStats.Partitions = new List<NameValueStats>();
|
||||
|
||||
NameValueStats old = AllStats.Partitions.FirstOrDefault(nvs => nvs.name == partition);
|
||||
|
||||
NameValueStats nw = new NameValueStats();
|
||||
if(old != null)
|
||||
{
|
||||
nw.name = old.name;
|
||||
nw.Value = old.Value + 1;
|
||||
AllStats.Partitions.Remove(old);
|
||||
}
|
||||
else
|
||||
{
|
||||
nw.name = partition;
|
||||
nw.Value = 1;
|
||||
}
|
||||
|
||||
AllStats.Partitions.Add(nw);
|
||||
|
||||
old = CurrentStats.Partitions.FirstOrDefault(nvs => nvs.name == partition);
|
||||
|
||||
nw = new NameValueStats();
|
||||
if(old != null)
|
||||
{
|
||||
nw.name = old.name;
|
||||
nw.Value = old.Value + 1;
|
||||
CurrentStats.Partitions.Remove(old);
|
||||
}
|
||||
else
|
||||
{
|
||||
nw.name = partition;
|
||||
nw.Value = 1;
|
||||
}
|
||||
|
||||
CurrentStats.Partitions.Add(nw);
|
||||
ctx.Partitions.Add(new Partition {Name = partition, Synchronized = false});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new filter to statistics
|
||||
/// </summary>
|
||||
/// <param name="format">Filter name</param>
|
||||
public static void AddFilter(string format)
|
||||
/// <param name="filter">Filter name</param>
|
||||
public static void AddFilter(string filter)
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(filter)) return;
|
||||
|
||||
if(Settings.Settings.Current.Stats == null || !Settings.Settings.Current.Stats.FilterStats) return;
|
||||
|
||||
ctx.Filters.Add(new Filter {Name = filter, Synchronized = false});
|
||||
|
||||
if(AllStats.Filters == null) AllStats.Filters = new List<NameValueStats>();
|
||||
if(CurrentStats.Filters == null) CurrentStats.Filters = new List<NameValueStats>();
|
||||
|
||||
NameValueStats old = AllStats.Filters.FirstOrDefault(nvs => nvs.name == format);
|
||||
NameValueStats old = AllStats.Filters.FirstOrDefault(nvs => nvs.name == filter);
|
||||
|
||||
NameValueStats nw = new NameValueStats();
|
||||
if(old != null)
|
||||
@@ -484,13 +340,13 @@ namespace DiscImageChef.Core
|
||||
}
|
||||
else
|
||||
{
|
||||
nw.name = format;
|
||||
nw.name = filter;
|
||||
nw.Value = 1;
|
||||
}
|
||||
|
||||
AllStats.Filters.Add(nw);
|
||||
|
||||
old = CurrentStats.Filters.FirstOrDefault(nvs => nvs.name == format);
|
||||
old = CurrentStats.Filters.FirstOrDefault(nvs => nvs.name == filter);
|
||||
|
||||
nw = new NameValueStats();
|
||||
if(old != null)
|
||||
@@ -501,7 +357,7 @@ namespace DiscImageChef.Core
|
||||
}
|
||||
else
|
||||
{
|
||||
nw.name = format;
|
||||
nw.name = filter;
|
||||
nw.Value = 1;
|
||||
}
|
||||
|
||||
@@ -514,44 +370,11 @@ namespace DiscImageChef.Core
|
||||
/// <param name="format">Media image name</param>
|
||||
public static void AddMediaFormat(string format)
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(format)) return;
|
||||
|
||||
if(Settings.Settings.Current.Stats == null || !Settings.Settings.Current.Stats.MediaImageStats) return;
|
||||
|
||||
if(AllStats.MediaImages == null) AllStats.MediaImages = new List<NameValueStats>();
|
||||
if(CurrentStats.MediaImages == null) CurrentStats.MediaImages = new List<NameValueStats>();
|
||||
|
||||
NameValueStats old = AllStats.MediaImages.FirstOrDefault(nvs => nvs.name == format);
|
||||
|
||||
NameValueStats nw = new NameValueStats();
|
||||
if(old != null)
|
||||
{
|
||||
nw.name = old.name;
|
||||
nw.Value = old.Value + 1;
|
||||
AllStats.MediaImages.Remove(old);
|
||||
}
|
||||
else
|
||||
{
|
||||
nw.name = format;
|
||||
nw.Value = 1;
|
||||
}
|
||||
|
||||
AllStats.MediaImages.Add(nw);
|
||||
|
||||
old = CurrentStats.MediaImages.FirstOrDefault(nvs => nvs.name == format);
|
||||
|
||||
nw = new NameValueStats();
|
||||
if(old != null)
|
||||
{
|
||||
nw.name = old.name;
|
||||
nw.Value = old.Value + 1;
|
||||
CurrentStats.MediaImages.Remove(old);
|
||||
}
|
||||
else
|
||||
{
|
||||
nw.name = format;
|
||||
nw.Value = 1;
|
||||
}
|
||||
|
||||
CurrentStats.MediaImages.Add(nw);
|
||||
ctx.MediaFormats.Add(new MediaFormat {Name = format, Synchronized = false});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace DiscImageChef.Database
|
||||
{
|
||||
public sealed class DicContext : DbContext
|
||||
{
|
||||
// Note: If table does not appear check that last migration has been REALLY added to the project
|
||||
public DicContext()
|
||||
{
|
||||
Database.Migrate();
|
||||
@@ -44,6 +45,11 @@ namespace DiscImageChef.Database
|
||||
|
||||
public DbSet<Device> Devices { get; set; }
|
||||
public DbSet<Report> Reports { get; set; }
|
||||
public DbSet<Command> Commands { get; set; }
|
||||
public DbSet<Filesystem> Filesystems { get; set; }
|
||||
public DbSet<Filter> Filters { get; set; }
|
||||
public DbSet<MediaFormat> MediaFormats { get; set; }
|
||||
public DbSet<Partition> Partitions { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
|
||||
@@ -64,8 +64,15 @@
|
||||
<Compile Include="Migrations\20181127001622_AddDeviceBasicFields.Designer.cs" />
|
||||
<Compile Include="Migrations\20181127013131_CorrectReportsDbSet.cs" />
|
||||
<Compile Include="Migrations\20181127013131_CorrectReportsDbSet.Designer.cs" />
|
||||
<Compile Include="Migrations\20181221015906_NameValueStatistics.cs" />
|
||||
<Compile Include="Migrations\20181221015906_NameValueStatistics.Designer.cs" />
|
||||
<Compile Include="Migrations\DicContextModelSnapshot.cs" />
|
||||
<Compile Include="Models\Command.cs" />
|
||||
<Compile Include="Models\Device.cs" />
|
||||
<Compile Include="Models\Filesystem.cs" />
|
||||
<Compile Include="Models\Filter.cs" />
|
||||
<Compile Include="Models\MediaFormat.cs" />
|
||||
<Compile Include="Models\Partition.cs" />
|
||||
<Compile Include="Models\Report.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
1329
DiscImageChef.Database/Migrations/20181221015906_NameValueStatistics.Designer.cs
generated
Normal file
1329
DiscImageChef.Database/Migrations/20181221015906_NameValueStatistics.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,70 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace DiscImageChef.Database.Migrations
|
||||
{
|
||||
public partial class NameValueStatistics : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable("Commands",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Synchronized = table.Column<bool>(nullable: false)
|
||||
}, constraints: table => { table.PrimaryKey("PK_Commands", x => x.Id); });
|
||||
|
||||
migrationBuilder.CreateTable("Filesystems",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Synchronized = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table => { table.PrimaryKey("PK_Filesystems", x => x.Id); });
|
||||
|
||||
migrationBuilder.CreateTable("Filters",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Synchronized = table.Column<bool>(nullable: false)
|
||||
}, constraints: table => { table.PrimaryKey("PK_Filters", x => x.Id); });
|
||||
|
||||
migrationBuilder.CreateTable("MediaFormats",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Synchronized = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table => { table.PrimaryKey("PK_MediaFormats", x => x.Id); });
|
||||
|
||||
migrationBuilder.CreateTable("Partitions",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Synchronized = table.Column<bool>(nullable: false)
|
||||
}, constraints: table => { table.PrimaryKey("PK_Partitions", x => x.Id); });
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable("Commands");
|
||||
|
||||
migrationBuilder.DropTable("Filesystems");
|
||||
|
||||
migrationBuilder.DropTable("Filters");
|
||||
|
||||
migrationBuilder.DropTable("MediaFormats");
|
||||
|
||||
migrationBuilder.DropTable("Partitions");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -824,6 +824,19 @@ namespace DiscImageChef.Database.Migrations
|
||||
b.ToTable("Usb");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Command", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Synchronized");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Commands");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Device", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
@@ -877,6 +890,58 @@ namespace DiscImageChef.Database.Migrations
|
||||
b.ToTable("Devices");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Filesystem", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Synchronized");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Filesystems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Filter", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Synchronized");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Filters");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.MediaFormat", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Synchronized");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MediaFormats");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Partition", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Synchronized");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Partitions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Report", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
12
DiscImageChef.Database/Models/Command.cs
Normal file
12
DiscImageChef.Database/Models/Command.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
public class Command
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
12
DiscImageChef.Database/Models/Filesystem.cs
Normal file
12
DiscImageChef.Database/Models/Filesystem.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
public class Filesystem
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
12
DiscImageChef.Database/Models/Filter.cs
Normal file
12
DiscImageChef.Database/Models/Filter.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
public class Filter
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
12
DiscImageChef.Database/Models/MediaFormat.cs
Normal file
12
DiscImageChef.Database/Models/MediaFormat.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
public class MediaFormat
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
12
DiscImageChef.Database/Models/Partition.cs
Normal file
12
DiscImageChef.Database/Models/Partition.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
public class Partition
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
||||
@@ -31,15 +31,19 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using CommandLine;
|
||||
using DiscImageChef.Commands;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Database;
|
||||
using DiscImageChef.Database.Migrations;
|
||||
using DiscImageChef.Gui.Forms;
|
||||
using DiscImageChef.Settings;
|
||||
using Eto;
|
||||
using Eto.Forms;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Statistics = DiscImageChef.Core.Statistics;
|
||||
|
||||
namespace DiscImageChef
|
||||
@@ -53,6 +57,10 @@ namespace DiscImageChef
|
||||
DicConsole.WriteEvent += System.Console.Write;
|
||||
DicConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine;
|
||||
|
||||
var ctx = new DicContext();
|
||||
ctx.Database.Migrate();
|
||||
ctx.SaveChanges();
|
||||
|
||||
Settings.Settings.LoadSettings();
|
||||
if((args.Length < 1 || args[0].ToLowerInvariant() != "gui") &&
|
||||
Settings.Settings.Current.GdprCompliance < DicSettings.GdprLevel) Configure.DoConfigure(true);
|
||||
|
||||
Reference in New Issue
Block a user