mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-05-19 02:37:55 +00:00
Do not allow dumping or converting to image formats that do not properly support hidden tracks when there is a hidden track in the media.
This commit is contained in:
Submodule Aaru.CommonTypes updated: 1cd4ae2924...de20a71982
@@ -548,6 +548,14 @@ sealed partial class Dump
|
||||
_dumpLog.WriteLine(Localization.Core.Disc_contains_a_hidden_track);
|
||||
UpdateStatus?.Invoke(Localization.Core.Disc_contains_a_hidden_track);
|
||||
|
||||
if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreHiddenTracks))
|
||||
{
|
||||
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_hidden_tracks);
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_hidden_tracks);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
List<Track> trkList = new()
|
||||
{
|
||||
new Track
|
||||
@@ -1112,8 +1120,10 @@ sealed partial class Dump
|
||||
sectorsForOffset = 0;
|
||||
}
|
||||
|
||||
mhddLog = new MhddLog(_outputPrefix + ".mhddlog.bin", _dev, blocks, blockSize, _maximumReadable, _private, _dimensions);
|
||||
ibgLog = new IbgLog(_outputPrefix + ".ibg", 0x0008);
|
||||
mhddLog = new MhddLog(_outputPrefix + ".mhddlog.bin", _dev, blocks, blockSize, _maximumReadable, _private,
|
||||
_dimensions);
|
||||
|
||||
ibgLog = new IbgLog(_outputPrefix + ".ibg", 0x0008);
|
||||
|
||||
if(_createGraph)
|
||||
{
|
||||
|
||||
@@ -56,7 +56,8 @@ public sealed partial class AaruFormat
|
||||
OpticalImageCapabilities.CanStoreMultipleTracks |
|
||||
OpticalImageCapabilities.CanStoreNotCdSessions |
|
||||
OpticalImageCapabilities.CanStoreNotCdTracks |
|
||||
OpticalImageCapabilities.CanStoreIndexes;
|
||||
OpticalImageCapabilities.CanStoreIndexes |
|
||||
OpticalImageCapabilities.CanStoreHiddenTracks;
|
||||
/// <inheritdoc />
|
||||
public ImageInfo Info => _imageInfo;
|
||||
/// <inheritdoc />
|
||||
|
||||
6
Aaru.Localization/Core.Designer.cs
generated
6
Aaru.Localization/Core.Designer.cs
generated
@@ -6875,5 +6875,11 @@ namespace Aaru.Localization {
|
||||
return ResourceManager.GetString("CompactDisc_Power_Management_Area_contained_in_image_WithMarkup", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string Output_format_does_not_support_hidden_tracks {
|
||||
get {
|
||||
return ResourceManager.GetString("Output_format_does_not_support_hidden_tracks", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3499,4 +3499,7 @@ It has no sense to do it, and it will put too much strain on the tape.</value>
|
||||
<data name="CompactDisc_Power_Management_Area_contained_in_image_WithMarkup" xml:space="preserve">
|
||||
<value>[bold]CompactDisc Power Management Area contained in image:[/]</value>
|
||||
</data>
|
||||
<data name="Output_format_does_not_support_hidden_tracks" xml:space="preserve">
|
||||
<value>Output format does not properly support storing hidden tracks, this will end in a loss of data, not continuing...</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -564,6 +564,21 @@ sealed class ConvertImageCommand : Command
|
||||
AaruConsole.ErrorWriteLine("Output format does not support sessions, this will end in a loss of data, continuing...");*/
|
||||
}
|
||||
|
||||
if((outputFormat as IWritableOpticalImage)?.OpticalCapabilities.HasFlag(OpticalImageCapabilities.
|
||||
CanStoreHiddenTracks) != true &&
|
||||
(inputFormat as IOpticalMediaImage)?.Tracks?.Any(t => t.Sequence == 0) == true)
|
||||
{
|
||||
// TODO: Disabled until 6.0
|
||||
/*if(!_force)
|
||||
{*/
|
||||
AaruConsole.ErrorWriteLine(Localization.Core.Output_format_does_not_support_hidden_tracks);
|
||||
|
||||
return (int)ErrorNumber.UnsupportedMedia;
|
||||
/*}
|
||||
|
||||
AaruConsole.ErrorWriteLine("Output format does not support sessions, this will end in a loss of data, continuing...");*/
|
||||
}
|
||||
|
||||
bool created = false;
|
||||
|
||||
Core.Spectre.ProgressSingleSpinner(ctx =>
|
||||
|
||||
Reference in New Issue
Block a user