diff --git a/Aaru.Localization/UI.resx b/Aaru.Localization/UI.resx index 57d1b06fd..7133e0a00 100644 --- a/Aaru.Localization/UI.resx +++ b/Aaru.Localization/UI.resx @@ -378,7 +378,7 @@ In you are unsure, please press N to not continue. Directory where extracted files will be created. Will abort if it exists - Identifying file filter... + [slateblue1]Identifying file filter...[/] Parsed options: @@ -393,7 +393,7 @@ In you are unsure, please press N to not continue. Specified encoding is not supported. - Identifying image format... + [slateblue1]Identifying image format...[/] Image format not identified, not proceeding with file extraction. @@ -414,7 +414,7 @@ In you are unsure, please press N to not continue. Destination exists, aborting. - Opening image file... + [slateblue1]Opening image file...[/] Unable to open image format @@ -1349,70 +1349,70 @@ In you are unsure, please press N to not continue. The specified image does not support any kind of verification - Verifying image checksums... + [slateblue1]Verifying image checksums...[/] - Disc image checksums are correct + [green]Disc image checksums are correct[/] - Disc image checksums are incorrect + [red]Disc image checksums are incorrect[/] - Disc image does not contain checksums + [olive]Disc image does not contain checksums[/] - Checking disc image checksums took {0} + [slateblue1]Checking disc image checksums took [aqua]{0}[/][/] Checking tracks... - Checking track {0} of {1} + [slateblue1]Checking track [teal]{0}[/] of [teal]{1}[/][/] Checking sector - Checking sector {0} of {1}, on track {2} + [slateblue1]Checking sector [lime]{0}[/] of [violet]{1}[/], on track [teal]{2}[/][/] Checking sectors... - Checking sector {0} of {1} + [slateblue1]Checking sector [lime]{0}[/] of [violet]{1}[/] - There is at least one sector that does not contain a checksum + [olive]There is at least one sector that does not contain a checksum[/] - There is at least one sector with incorrect checksum or errors + [red]There is at least one sector with incorrect checksum or errors[/] - All sector checksums are correct + [green]All sector checksums are correct[/] - Checking sector checksums took {0} + [slateblue1]Checking sector checksums took [aqua]{0}[/][/] - LBAs with error: + [slateblue1]LBAs with error:[/] - all sectors. + [red]all sectors.[/] - LBAs without checksum: + [slateblue1]LBAs without checksum:[/] - Total sectors........... + [bold][italic][slateblue1]Total sectors[/][/][/] - Total errors............ + [bold][italic][slateblue1]Total errors[/][/][/] - Total unknowns.......... + [bold][italic][slateblue1]Total unknowns[/][/][/] - Total errors+unknowns... + [bold][italic][slateblue1]Total errors+unknowns[/][/][/] Try to read first track pregap. Only applicable to CD/DDCD/GD. diff --git a/Aaru/Commands/Image/Verify.cs b/Aaru/Commands/Image/Verify.cs index b09bb37e4..720670da7 100644 --- a/Aaru/Commands/Image/Verify.cs +++ b/Aaru/Commands/Image/Verify.cs @@ -164,7 +164,7 @@ sealed class VerifyCommand : Command correctImage = discCheckStatus; AaruLogging.Verbose(UI.Checking_disc_image_checksums_took_0, - chkWatch.Elapsed.Humanize(minUnit: TimeUnit.Second)); + chkWatch.Elapsed.Humanize(minUnit: TimeUnit.Second)); } if(!settings.VerifySectors) @@ -191,16 +191,14 @@ sealed class VerifyCommand : Command if(spiralParameters is not null) { - mediaGraph = new Spiral((int)settings.Dimensions, - (int)settings.Dimensions, + mediaGraph = new Spiral(settings.Dimensions, + settings.Dimensions, spiralParameters, opticalMediaImage.Info.Sectors); } else if(settings.CreateGraph) { - mediaGraph = new BlockMap((int)settings.Dimensions, - (int)settings.Dimensions, - opticalMediaImage.Info.Sectors); + mediaGraph = new BlockMap(settings.Dimensions, settings.Dimensions, opticalMediaImage.Info.Sectors); } List inputTracks = opticalMediaImage.Tracks; @@ -390,8 +388,7 @@ sealed class VerifyCommand : Command if(unknownLbas.Count == 0 && failingLbas.Count == 0) AaruLogging.WriteLine(UI.All_sector_checksums_are_correct); - AaruLogging.Verbose(UI.Checking_sector_checksums_took_0, - stopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)); + AaruLogging.Verbose(UI.Checking_sector_checksums_took_0, stopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)); if(settings.Verbose) { @@ -400,25 +397,37 @@ sealed class VerifyCommand : Command 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); } - // TODO: Convert to table - AaruLogging.WriteLine($"[italic]{UI.Total_sectors}[/] {inputFormat.Info.Sectors}"); - AaruLogging.WriteLine($"[italic]{UI.Total_errors}[/] {failingLbas.Count}"); - AaruLogging.WriteLine($"[italic]{UI.Total_unknowns}[/] {unknownLbas.Count}"); - AaruLogging.WriteLine($"[italic]{UI.Total_errors_plus_unknowns}[/] {failingLbas.Count + unknownLbas.Count}"); + var table = new Table(); + table.HideHeaders(); + table.AddColumn(new TableColumn("").RightAligned()); + table.AddColumn(new TableColumn("").RightAligned()); + table.Border(TableBorder.Rounded); + table.BorderColor(Color.Yellow); + + + table.AddRow(UI.Total_sectors, $"[lime]{inputFormat.Info.Sectors}[/]"); + table.AddRow(UI.Total_errors, $"[lime]{failingLbas.Count}[/]"); + table.AddRow(UI.Total_unknowns, $"[lime]{unknownLbas.Count}[/]"); + table.AddRow(UI.Total_errors_plus_unknowns, $"[lime]{failingLbas.Count + unknownLbas.Count}[/]"); + + AnsiConsole.Write(table); + + AaruLogging.Information($"{UI.Total_sectors}: {inputFormat.Info.Sectors}"); + AaruLogging.Information($"{UI.Total_errors}: {failingLbas.Count}"); + AaruLogging.Information($"{UI.Total_unknowns}: {unknownLbas.Count}"); + AaruLogging.Information($"{UI.Total_errors_plus_unknowns}: {failingLbas.Count + unknownLbas.Count}"); mediaGraph?.WriteTo($"{Path.GetFileNameWithoutExtension(inputFilter.Filename)}.verify.png"); @@ -459,7 +468,7 @@ sealed class VerifyCommand : Command [Description("Dimensions, as a square, in pixels, for the graph of verified media.")] [DefaultValue(1080)] [CommandOption("-d|--dimensions")] - public uint Dimensions { get; init; } + public int Dimensions { get; init; } [Description("Disc image path")] [CommandArgument(0, "")] public string ImagePath { get; init; }