From b31d40bd8769bcab625d6fe9bb4e1510c39ed57d Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 2 May 2019 00:24:56 +0100 Subject: [PATCH] On resume dumping a SSC tape get last written partition and file. --- DiscImageChef.Core/Devices/Dumping/SSC.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/DiscImageChef.Core/Devices/Dumping/SSC.cs b/DiscImageChef.Core/Devices/Dumping/SSC.cs index f26d66b19..f85be218e 100644 --- a/DiscImageChef.Core/Devices/Dumping/SSC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SSC.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System; +using System.Linq; using System.Threading; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Extents; @@ -653,6 +654,23 @@ namespace DiscImageChef.Core.Devices.Dumping TapePartition currentTapePartition = new TapePartition {Number = currentPartition, FirstBlock = currentBlock}; + if((canLocate || canLocateLong) && resume.NextBlock > 0) + { + currentBlock = resume.NextBlock; + + currentTapeFile = + (outputPlugin as IWritableTapeImage).Files.FirstOrDefault(f => f.LastBlock == + (outputPlugin as IWritableTapeImage) + ?.Files.Max(g => g.LastBlock)); + + currentTapePartition = + (outputPlugin as IWritableTapeImage).TapePartitions.FirstOrDefault(p => p.LastBlock == + (outputPlugin as + IWritableTapeImage) + ?.TapePartitions + .Max(g => g.LastBlock)); + } + DateTime timeSpeedStart = DateTime.UtcNow; ulong currentSpeedSize = 0; double imageWriteDuration = 0;