mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add tape field to resume file.
This commit is contained in:
@@ -54,6 +54,7 @@ namespace DiscImageChef.CommonTypes.Metadata
|
|||||||
public bool Removable;
|
public bool Removable;
|
||||||
public ulong LastBlock;
|
public ulong LastBlock;
|
||||||
public ulong NextBlock;
|
public ulong NextBlock;
|
||||||
|
public bool Tape;
|
||||||
|
|
||||||
[XmlArrayItem("DumpTry")]
|
[XmlArrayItem("DumpTry")]
|
||||||
public List<DumpHardwareType> Tries;
|
public List<DumpHardwareType> Tries;
|
||||||
|
|||||||
@@ -66,17 +66,22 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
internal static void Process(bool isLba, bool removable, ulong blocks,
|
internal static void Process(bool isLba, bool removable, ulong blocks,
|
||||||
string manufacturer, string model,
|
string manufacturer, string model,
|
||||||
string serial, PlatformID platform, ref Resume resume,
|
string serial, PlatformID platform, ref Resume resume,
|
||||||
ref DumpHardwareType currentTry, ref ExtentsULong extents)
|
ref DumpHardwareType currentTry, ref ExtentsULong extents,
|
||||||
|
bool isTape = false)
|
||||||
{
|
{
|
||||||
if(resume != null)
|
if(resume != null)
|
||||||
{
|
{
|
||||||
if(!isLba) throw new NotImplementedException("Resuming CHS devices is currently not supported.");
|
if(!isLba) throw new NotImplementedException("Resuming CHS devices is currently not supported.");
|
||||||
|
|
||||||
|
if(resume.Tape != isTape)
|
||||||
|
throw new
|
||||||
|
InvalidOperationException($"Resume file specifies a {(resume.Tape ? "tape" : "not tape")} device but you're requesting to dump a {(isTape ? "tape" : "not tape")} device, not continuing...");
|
||||||
|
|
||||||
if(resume.Removable != removable)
|
if(resume.Removable != removable)
|
||||||
throw new
|
throw new
|
||||||
InvalidOperationException($"Resume file specifies a {(resume.Removable ? "removable" : "non removable")} device but you're requesting to dump a {(removable ? "removable" : "non removable")} device, not continuing...");
|
InvalidOperationException($"Resume file specifies a {(resume.Removable ? "removable" : "non removable")} device but you're requesting to dump a {(removable ? "removable" : "non removable")} device, not continuing...");
|
||||||
|
|
||||||
if(resume.LastBlock != blocks - 1)
|
if(!isTape && resume.LastBlock != blocks - 1)
|
||||||
throw new
|
throw new
|
||||||
InvalidOperationException($"Resume file specifies a device with {resume.LastBlock + 1} blocks but you're requesting to dump one with {blocks} blocks, not continuing...");
|
InvalidOperationException($"Resume file specifies a device with {resume.LastBlock + 1} blocks but you're requesting to dump one with {blocks} blocks, not continuing...");
|
||||||
|
|
||||||
@@ -131,7 +136,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
Tries = new List<DumpHardwareType>(),
|
Tries = new List<DumpHardwareType>(),
|
||||||
CreationDate = DateTime.UtcNow,
|
CreationDate = DateTime.UtcNow,
|
||||||
BadBlocks = new List<ulong>(),
|
BadBlocks = new List<ulong>(),
|
||||||
LastBlock = blocks - 1
|
LastBlock = blocks - 1,
|
||||||
|
Tape = isTape
|
||||||
};
|
};
|
||||||
currentTry = new DumpHardwareType
|
currentTry = new DumpHardwareType
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user