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.Threading;
|
||||
using System.Windows.Input;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Core;
|
||||
@@ -125,6 +126,8 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
[ObservableProperty]
|
||||
bool _verifyImageEnabled;
|
||||
[ObservableProperty]
|
||||
bool _VerifyOnlyDataChecked;
|
||||
[ObservableProperty]
|
||||
bool _verifySectorsChecked;
|
||||
[ObservableProperty]
|
||||
bool _verifySectorsEnabled;
|
||||
@@ -143,6 +146,7 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
UnknownList = [];
|
||||
VerifyImageEnabled = true;
|
||||
VerifySectorsEnabled = true;
|
||||
VerifyOnlyDataChecked = true;
|
||||
CloseVisible = true;
|
||||
StartVisible = true;
|
||||
OptionsVisible = true;
|
||||
@@ -285,6 +289,8 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
|
||||
foreach(Track currentTrack in inputOptical.Tracks)
|
||||
{
|
||||
if(VerifyOnlyDataChecked && currentTrack.Type == TrackType.Audio) continue;
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
ProgressText = string.Format(UI.Verifying_track_0_of_1,
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
RowSpacing="8"
|
||||
Margin="12">
|
||||
<Grid Grid.Row="0"
|
||||
RowDefinitions="Auto,Auto"
|
||||
RowDefinitions="Auto,Auto,Auto"
|
||||
RowSpacing="8"
|
||||
IsVisible="{Binding OptionsVisible, Mode=OneWay}">
|
||||
<CheckBox Grid.Row="0"
|
||||
@@ -68,6 +68,12 @@
|
||||
IsVisible="{Binding VerifySectorsVisible, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Verify_all_sectors_if_supported}" />
|
||||
</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.Row="1"
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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">
|
||||
<value>Encriptación</value>
|
||||
</data>
|
||||
<data name="Verify_only_data_help" xml:space="preserve">
|
||||
<value>Verificar sólo pistas de datos.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -3413,4 +3413,7 @@ Do you want to continue?</value>
|
||||
<data name="Encryption" xml:space="preserve">
|
||||
<value>Encryption</value>
|
||||
</data>
|
||||
<data name="Verify_only_data_help" xml:space="preserve">
|
||||
<value>Verify only data tracks.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -66,6 +66,7 @@ sealed class VerifyCommand : Command<VerifyCommand.Settings>
|
||||
AaruLogging.Debug(MODULE_NAME, "--verify-sectors={0}", settings.VerifySectors);
|
||||
AaruLogging.Debug(MODULE_NAME, "--create-graph={0}", settings.CreateGraph);
|
||||
AaruLogging.Debug(MODULE_NAME, "--dimensions={0}", settings.Dimensions);
|
||||
AaruLogging.Debug(MODULE_NAME, " --data-only={0}", settings.DataOnly);
|
||||
|
||||
IFilter inputFilter = null;
|
||||
|
||||
@@ -215,6 +216,8 @@ sealed class VerifyCommand : Command<VerifyCommand.Settings>
|
||||
|
||||
foreach(Track currentTrack in inputTracks)
|
||||
{
|
||||
if(settings.DataOnly && currentTrack.Type == TrackType.Audio) continue;
|
||||
|
||||
discTask.Description =
|
||||
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)
|
||||
AaruLogging.Verbose($"\t[red]{UI.all_sectors}[/]");
|
||||
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}[/]");
|
||||
|
||||
if(unknownLbas.Count == (int)inputFormat.Info.Sectors)
|
||||
AaruLogging.Verbose($"\t[yellow3_1]{UI.all_sectors}[/]");
|
||||
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();
|
||||
@@ -467,6 +472,10 @@ sealed class VerifyCommand : Command<VerifyCommand.Settings>
|
||||
[DefaultValue(1080)]
|
||||
[CommandOption("-d|--dimensions")]
|
||||
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))]
|
||||
[CommandArgument(0, "<image-path>")]
|
||||
public string ImagePath { get; init; }
|
||||
|
||||
Reference in New Issue
Block a user