On resume dumping a SSC tape get last written partition and file.

This commit is contained in:
2019-05-02 00:24:56 +01:00
parent 3555fec6e4
commit b31d40bd87

View File

@@ -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;