From a5301085c3ec3a3f83b8b2c0ca2f4c765136271b Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Tue, 14 Sep 2021 16:12:13 +0100 Subject: [PATCH] Fix dumping non-CD optical media when drive does not return track list. --- Aaru.Core/Devices/Dumping/Sbc/Dump.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs index b9082ffef..ffe8f9a1d 100644 --- a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs +++ b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs @@ -376,6 +376,8 @@ namespace Aaru.Core.Devices.Dumping sense = _dev.ReadDiscInformation(out readBuffer, out _, MmcDiscInformationDataTypes.DiscInformation, _dev.Timeout, out _); + bool writeSingleOpticalTrack = true; + if(!sense) { DiscInformation.StandardDiscInformation? discInformation = @@ -391,6 +393,8 @@ namespace Aaru.Core.Devices.Dumping if(discInformation.HasValue) { + writeSingleOpticalTrack = false; + if(discInformation?.Sessions > 1 && !canStoreNotCdSessions) { @@ -556,6 +560,28 @@ namespace Aaru.Core.Devices.Dumping }); } } + + if(writeSingleOpticalTrack) + { + _dumpLog.WriteLine("Creating single track as could not retrieve track list from drive."); + + StoppingErrorMessage?. + Invoke("Creating single track as could not retrieve track list from drive."); + + opticalPlugin.SetTracks(new List + { + new Track + { + TrackBytesPerSector = (int)blockSize, + TrackEndSector = blocks - 1, + TrackSequence = 1, + TrackRawBytesPerSector = (int)blockSize, + TrackSubchannelType = TrackSubchannelType.None, + TrackSession = 1, + TrackType = TrackType.Data + } + }); + } } else {