🐛Correct setting resume before closing image.

This commit is contained in:
2018-02-01 01:20:41 +00:00
parent 43938e60e7
commit 0ff3296b1f
3 changed files with 16 additions and 16 deletions

View File

@@ -482,6 +482,13 @@ namespace DiscImageChef.Core.Devices.Dumping
}
}
DumpHardwareType currentTry = null;
ExtentsULong extents = null;
ResumeSupport.Process(true, true, blocks, dev.Manufacturer, dev.Model, dev.Serial, dev.PlatformId,
ref resume, ref currentTry, ref extents);
if(currentTry == null || extents == null)
throw new InvalidOperationException("Could not process resume file, not continuing...");
// Try to read the Lead-in
if(dumpLeadIn)
{
@@ -574,13 +581,6 @@ namespace DiscImageChef.Core.Devices.Dumping
DicConsole.WriteLine("SCSI device type: {0}.", dev.ScsiType);
DicConsole.WriteLine("Media identified as {0}.", dskType);
DumpHardwareType currentTry = null;
ExtentsULong extents = null;
ResumeSupport.Process(true, true, blocks, dev.Manufacturer, dev.Model, dev.Serial, dev.PlatformId,
ref resume, ref currentTry, ref extents);
if(currentTry == null || extents == null)
throw new InvalidOperationException("Could not process resume file, not continuing...");
MhddLog mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
IbgLog ibgLog = new IbgLog(outputPrefix + ".ibg", 0x0008);
bool ret = outputPlugin.Create(outputPath, dskType, formatOptions, blocks, SECTOR_SIZE);
@@ -888,15 +888,15 @@ namespace DiscImageChef.Core.Devices.Dumping
throw new ArgumentException(outputPlugin.ErrorMessage);
}
resume.BadBlocks.Sort();
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
outputPlugin.SetDumpHardware(resume.Tries);
if(preSidecar != null) outputPlugin.SetCicmMetadata(preSidecar);
dumpLog.WriteLine("Closing output file.");
DicConsole.WriteLine("Closing output file.");
outputPlugin.Close();
resume.BadBlocks.Sort();
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
if(aborted)
{
dumpLog.WriteLine("Aborted!");

View File

@@ -646,15 +646,15 @@ namespace DiscImageChef.Core.Devices.Dumping
}
}
resume.BadBlocks.Sort();
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
outputPlugin.SetDumpHardware(resume.Tries);
if(preSidecar != null) outputPlugin.SetCicmMetadata(preSidecar);
dumpLog.WriteLine("Closing output file.");
DicConsole.WriteLine("Closing output file.");
outputPlugin.Close();
resume.BadBlocks.Sort();
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
if(aborted)
{
dumpLog.WriteLine("Aborted!");

View File

@@ -771,15 +771,15 @@ namespace DiscImageChef.Core.Devices.Dumping
throw new ArgumentException(outputPlugin.ErrorMessage);
}
resume.BadBlocks.Sort();
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
outputPlugin.SetDumpHardware(resume.Tries);
if(preSidecar != null) outputPlugin.SetCicmMetadata(preSidecar);
dumpLog.WriteLine("Closing output file.");
DicConsole.WriteLine("Closing output file.");
outputPlugin.Close();
resume.BadBlocks.Sort();
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
if(aborted)
{
dumpLog.WriteLine("Aborted!");