mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Convert track pregap warning into a single LINQ query.
This commit is contained in:
@@ -339,27 +339,13 @@ namespace Aaru.Core.Devices.Dumping
|
||||
}
|
||||
|
||||
if(!(_outputPlugin as IWritableOpticalImage).OpticalCapabilities.HasFlag(OpticalImageCapabilities.
|
||||
CanStorePregaps))
|
||||
CanStorePregaps) &&
|
||||
tracks.Where(track => track.TrackSequence !=
|
||||
tracks.First(t => t.TrackSession == track.TrackSession).TrackSequence).
|
||||
Any(track => track.TrackPregap > 0))
|
||||
{
|
||||
foreach(Track track in tracks)
|
||||
if(!_force)
|
||||
{
|
||||
if(track.TrackSequence == tracks.First(t => t.TrackSession == track.TrackSession).TrackSequence)
|
||||
continue;
|
||||
|
||||
if(track.TrackPregap <= 0)
|
||||
continue;
|
||||
|
||||
if(_force)
|
||||
{
|
||||
_dumpLog.
|
||||
WriteLine("Output format does not support pregaps, this may end in a loss of data, continuing...");
|
||||
|
||||
ErrorMessage?.
|
||||
Invoke("Output format does not support pregaps, this may end in a loss of data, continuing...");
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine("Output format does not support pregaps, this may end in a loss of data, not continuing...");
|
||||
|
||||
StoppingErrorMessage?.
|
||||
@@ -367,6 +353,11 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine("Output format does not support pregaps, this may end in a loss of data, continuing...");
|
||||
|
||||
ErrorMessage?.
|
||||
Invoke("Output format does not support pregaps, this may end in a loss of data, continuing...");
|
||||
}
|
||||
|
||||
for(int t = 1; t < tracks.Length; t++)
|
||||
|
||||
Reference in New Issue
Block a user