Address Github code quality issues

This commit is contained in:
Rebecca Wallander
2026-02-28 08:18:54 +01:00
parent 47b9b5dbe5
commit 668fb57524
4 changed files with 20 additions and 5 deletions

View File

@@ -403,9 +403,9 @@ partial class Dump
if(scsiReader.OmniDriveReadRaw &&
decodedPfi.HasValue &&
((dskType >= MediaType.DVDROM && dskType <= MediaType.DVDDownload)
|| dskType != MediaType.PS2DVD
|| dskType != MediaType.PS3DVD
|| dskType != MediaType.Nuon))
|| dskType == MediaType.PS2DVD
|| dskType == MediaType.PS3DVD
|| dskType == MediaType.Nuon))
nominalNegativeSectors = Math.Min(nominalNegativeSectors, DvdLeadinSectors);
mediaTags.TryGetValue(MediaTagType.BD_DI, out byte[] di);

View File

@@ -77,6 +77,12 @@ partial class Dump
uint blocksToRead = maxBlocksToRead;
var outputFormat = _outputPlugin as IWritableImage;
if(outputFormat is null)
{
ErrorMessage?.Invoke(Localization.Core.Output_format_not_initialized);
return;
}
InitProgress?.Invoke();
if(scsiReader.HldtstReadRaw && _resume.NextBlock > 0)
@@ -160,7 +166,7 @@ partial class Dump
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
if(elapsed > 0)
{
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
currentSpeed = (double)sectorSpeedStart * blockSize / (1048576d * elapsed);
sectorSpeedStart = 0;
_speedStopwatch.Restart();
}
@@ -361,7 +367,7 @@ partial class Dump
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
if(elapsed > 0)
{
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
currentSpeed = (double)sectorSpeedStart * blockSize / (1048576d * elapsed);
sectorSpeedStart = 0;
_speedStopwatch.Restart();
}

View File

@@ -6946,5 +6946,11 @@ namespace Aaru.Localization {
return ResourceManager.GetString("Reading_data_sectors", resourceCulture);
}
}
public static string Output_format_not_initialized {
get {
return ResourceManager.GetString("Output_format_not_initialized", resourceCulture);
}
}
}
}

View File

@@ -3544,4 +3544,7 @@ It has no sense to do it, and it will put too much strain on the tape.</value>
<data name="Reading_data_sectors" xml:space="preserve">
<value>[slateblue1]Reading data sectors...[/]</value>
</data>
<data name="Output_format_not_initialized" xml:space="preserve">
<value>[red]Output format not initialized.[/]</value>
</data>
</root>