mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Calculate track sizes and pregaps in media info.
This commit is contained in:
@@ -33,15 +33,20 @@
|
||||
using System.Collections.Generic;
|
||||
using System.CommandLine;
|
||||
using System.CommandLine.Invocation;
|
||||
using System.Linq;
|
||||
using DiscImageChef.CommonTypes.Enums;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Database;
|
||||
using DiscImageChef.Database.Models;
|
||||
using DiscImageChef.Decoders.ATA;
|
||||
using DiscImageChef.Decoders.PCMCIA;
|
||||
using DiscImageChef.Decoders.SCSI;
|
||||
using DiscImageChef.Decoders.SCSI.MMC;
|
||||
using DiscImageChef.Decoders.SCSI.SSC;
|
||||
using DiscImageChef.Devices;
|
||||
using Command = System.CommandLine.Command;
|
||||
using Device = DiscImageChef.Devices.Device;
|
||||
using DeviceInfo = DiscImageChef.Core.Devices.Info.DeviceInfo;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
@@ -1066,6 +1071,33 @@ namespace DiscImageChef.Commands
|
||||
|
||||
dev.Close();
|
||||
|
||||
DicConsole.WriteLine();
|
||||
|
||||
// Open master database
|
||||
var ctx = DicContext.Create(Settings.Settings.MasterDbPath);
|
||||
|
||||
// Search for device in master database
|
||||
Database.Models.Device dbDev =
|
||||
ctx.Devices.FirstOrDefault(d => d.Manufacturer == dev.Manufacturer && d.Model == dev.Model &&
|
||||
d.Revision == dev.Revision);
|
||||
|
||||
if(dbDev is null)
|
||||
DicConsole.WriteLine("Device not in database, please create a device report and attach it to a Github issue.");
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine($"Device in database since {dbDev.LastSynchronized}.");
|
||||
|
||||
if(dbDev.OptimalMultipleSectorsRead > 0)
|
||||
DicConsole.WriteLine($"Optimal multiple read is {dbDev.LastSynchronized} sectors.");
|
||||
}
|
||||
|
||||
// Search for read offset in master database
|
||||
CdOffset cdOffset =
|
||||
ctx.CdOffsets.FirstOrDefault(d => d.Manufacturer == dev.Manufacturer && d.Model == dev.Model);
|
||||
|
||||
DicConsole.WriteLine(cdOffset is null ? "CD reading offset not found in database."
|
||||
: $"CD reading offset is {cdOffset.Offset} samples ({cdOffset.Offset * 4} bytes).");
|
||||
|
||||
return(int)ErrorNumber.NoError;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user