mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Image verification] Allow to verify only data (non-audio) tracks.
This commit is contained in:
@@ -38,6 +38,7 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using Aaru.CommonTypes.Enums;
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
using Aaru.CommonTypes.Structs;
|
using Aaru.CommonTypes.Structs;
|
||||||
using Aaru.Core;
|
using Aaru.Core;
|
||||||
@@ -125,6 +126,8 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
|||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
bool _verifyImageEnabled;
|
bool _verifyImageEnabled;
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
|
bool _VerifyOnlyDataChecked;
|
||||||
|
[ObservableProperty]
|
||||||
bool _verifySectorsChecked;
|
bool _verifySectorsChecked;
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
bool _verifySectorsEnabled;
|
bool _verifySectorsEnabled;
|
||||||
@@ -143,6 +146,7 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
|||||||
UnknownList = [];
|
UnknownList = [];
|
||||||
VerifyImageEnabled = true;
|
VerifyImageEnabled = true;
|
||||||
VerifySectorsEnabled = true;
|
VerifySectorsEnabled = true;
|
||||||
|
VerifyOnlyDataChecked = true;
|
||||||
CloseVisible = true;
|
CloseVisible = true;
|
||||||
StartVisible = true;
|
StartVisible = true;
|
||||||
OptionsVisible = true;
|
OptionsVisible = true;
|
||||||
@@ -285,6 +289,8 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
|||||||
|
|
||||||
foreach(Track currentTrack in inputOptical.Tracks)
|
foreach(Track currentTrack in inputOptical.Tracks)
|
||||||
{
|
{
|
||||||
|
if(VerifyOnlyDataChecked && currentTrack.Type == TrackType.Audio) continue;
|
||||||
|
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
ProgressText = string.Format(UI.Verifying_track_0_of_1,
|
ProgressText = string.Format(UI.Verifying_track_0_of_1,
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
RowSpacing="8"
|
RowSpacing="8"
|
||||||
Margin="12">
|
Margin="12">
|
||||||
<Grid Grid.Row="0"
|
<Grid Grid.Row="0"
|
||||||
RowDefinitions="Auto,Auto"
|
RowDefinitions="Auto,Auto,Auto"
|
||||||
RowSpacing="8"
|
RowSpacing="8"
|
||||||
IsVisible="{Binding OptionsVisible, Mode=OneWay}">
|
IsVisible="{Binding OptionsVisible, Mode=OneWay}">
|
||||||
<CheckBox Grid.Row="0"
|
<CheckBox Grid.Row="0"
|
||||||
@@ -68,6 +68,12 @@
|
|||||||
IsVisible="{Binding VerifySectorsVisible, Mode=OneWay}">
|
IsVisible="{Binding VerifySectorsVisible, Mode=OneWay}">
|
||||||
<TextBlock Text="{x:Static localization:UI.Verify_all_sectors_if_supported}" />
|
<TextBlock Text="{x:Static localization:UI.Verify_all_sectors_if_supported}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
|
<CheckBox Grid.Row="2"
|
||||||
|
IsChecked="{Binding VerifyOnlyDataChecked, Mode=TwoWay}"
|
||||||
|
IsEnabled="{Binding VerifySectorsEnabled, Mode=OneWay}"
|
||||||
|
IsVisible="{Binding VerifySectorsVisible, Mode=OneWay}">
|
||||||
|
<TextBlock Text="{x:Static localization:UI.Verify_only_data_help}" />
|
||||||
|
</CheckBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Grid.Row="1"
|
<Grid Grid.Row="1"
|
||||||
RowDefinitions="*, Auto"
|
RowDefinitions="*, Auto"
|
||||||
|
|||||||
6
Aaru.Localization/UI.Designer.cs
generated
6
Aaru.Localization/UI.Designer.cs
generated
@@ -6675,5 +6675,11 @@ namespace Aaru.Localization {
|
|||||||
return ResourceManager.GetString("Encryption", resourceCulture);
|
return ResourceManager.GetString("Encryption", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string Verify_only_data_help {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Verify_only_data_help", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3338,4 +3338,7 @@ Probadores:
|
|||||||
<data name="Encryption" xml:space="preserve">
|
<data name="Encryption" xml:space="preserve">
|
||||||
<value>Encriptación</value>
|
<value>Encriptación</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Verify_only_data_help" xml:space="preserve">
|
||||||
|
<value>Verificar sólo pistas de datos.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -3413,4 +3413,7 @@ Do you want to continue?</value>
|
|||||||
<data name="Encryption" xml:space="preserve">
|
<data name="Encryption" xml:space="preserve">
|
||||||
<value>Encryption</value>
|
<value>Encryption</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Verify_only_data_help" xml:space="preserve">
|
||||||
|
<value>Verify only data tracks.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -66,6 +66,7 @@ sealed class VerifyCommand : Command<VerifyCommand.Settings>
|
|||||||
AaruLogging.Debug(MODULE_NAME, "--verify-sectors={0}", settings.VerifySectors);
|
AaruLogging.Debug(MODULE_NAME, "--verify-sectors={0}", settings.VerifySectors);
|
||||||
AaruLogging.Debug(MODULE_NAME, "--create-graph={0}", settings.CreateGraph);
|
AaruLogging.Debug(MODULE_NAME, "--create-graph={0}", settings.CreateGraph);
|
||||||
AaruLogging.Debug(MODULE_NAME, "--dimensions={0}", settings.Dimensions);
|
AaruLogging.Debug(MODULE_NAME, "--dimensions={0}", settings.Dimensions);
|
||||||
|
AaruLogging.Debug(MODULE_NAME, " --data-only={0}", settings.DataOnly);
|
||||||
|
|
||||||
IFilter inputFilter = null;
|
IFilter inputFilter = null;
|
||||||
|
|
||||||
@@ -215,6 +216,8 @@ sealed class VerifyCommand : Command<VerifyCommand.Settings>
|
|||||||
|
|
||||||
foreach(Track currentTrack in inputTracks)
|
foreach(Track currentTrack in inputTracks)
|
||||||
{
|
{
|
||||||
|
if(settings.DataOnly && currentTrack.Type == TrackType.Audio) continue;
|
||||||
|
|
||||||
discTask.Description =
|
discTask.Description =
|
||||||
string.Format(UI.Checking_track_0_of_1, discTask.Value + 1, inputTracks.Count);
|
string.Format(UI.Checking_track_0_of_1, discTask.Value + 1, inputTracks.Count);
|
||||||
|
|
||||||
@@ -395,16 +398,18 @@ sealed class VerifyCommand : Command<VerifyCommand.Settings>
|
|||||||
if(failingLbas.Count == (int)inputFormat.Info.Sectors)
|
if(failingLbas.Count == (int)inputFormat.Info.Sectors)
|
||||||
AaruLogging.Verbose($"\t[red]{UI.all_sectors}[/]");
|
AaruLogging.Verbose($"\t[red]{UI.all_sectors}[/]");
|
||||||
else
|
else
|
||||||
foreach(ulong t in failingLbas)
|
{
|
||||||
AaruLogging.Verbose("\t{0}", t);
|
foreach(ulong t in failingLbas) AaruLogging.Verbose("\t{0}", t);
|
||||||
|
}
|
||||||
|
|
||||||
AaruLogging.WriteLine($"[yellow3_1]{UI.LBAs_without_checksum}[/]");
|
AaruLogging.WriteLine($"[yellow3_1]{UI.LBAs_without_checksum}[/]");
|
||||||
|
|
||||||
if(unknownLbas.Count == (int)inputFormat.Info.Sectors)
|
if(unknownLbas.Count == (int)inputFormat.Info.Sectors)
|
||||||
AaruLogging.Verbose($"\t[yellow3_1]{UI.all_sectors}[/]");
|
AaruLogging.Verbose($"\t[yellow3_1]{UI.all_sectors}[/]");
|
||||||
else
|
else
|
||||||
foreach(ulong t in unknownLbas)
|
{
|
||||||
AaruLogging.Verbose("\t{0}", t);
|
foreach(ulong t in unknownLbas) AaruLogging.Verbose("\t{0}", t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var table = new Table();
|
var table = new Table();
|
||||||
@@ -467,6 +472,10 @@ sealed class VerifyCommand : Command<VerifyCommand.Settings>
|
|||||||
[DefaultValue(1080)]
|
[DefaultValue(1080)]
|
||||||
[CommandOption("-d|--dimensions")]
|
[CommandOption("-d|--dimensions")]
|
||||||
public int Dimensions { get; init; }
|
public int Dimensions { get; init; }
|
||||||
|
[LocalizedDescription(nameof(UI.Verify_only_data_help))]
|
||||||
|
[DefaultValue(true)]
|
||||||
|
[CommandOption("-t|--data-only")]
|
||||||
|
public bool DataOnly { get; init; }
|
||||||
[LocalizedDescription(nameof(UI.Media_image_path))]
|
[LocalizedDescription(nameof(UI.Media_image_path))]
|
||||||
[CommandArgument(0, "<image-path>")]
|
[CommandArgument(0, "<image-path>")]
|
||||||
public string ImagePath { get; init; }
|
public string ImagePath { get; init; }
|
||||||
|
|||||||
Reference in New Issue
Block a user