Fix audio disc error count (fixes #215)

This commit is contained in:
Matt Nadareski
2020-08-02 21:22:24 -07:00
parent 7296d109cc
commit 34ac5f9ba0

View File

@@ -1580,6 +1580,11 @@ namespace DICUI.DiscImageCreator
{
string outputDirectory = Path.GetDirectoryName(basePath);
// Some disc types are audio-only
bool audioOnly = (system == KnownSystem.AtariJaguarCD)
|| (system == KnownSystem.AudioCD)
|| (system == KnownSystem.SuperAudioCD);
// Fill in the hash data
info.TracksAndWriteOffsets.ClrMameProData = GetDatfile(basePath + ".dat");
@@ -1590,13 +1595,22 @@ namespace DICUI.DiscImageCreator
case MediaType.GDROM: // TODO: Verify GD-ROM outputs this
info.Extras.PVD = GetPVD(basePath + "_mainInfo.txt") ?? "Disc has no PVD"; ;
long errorCount = -1;
if (File.Exists(basePath + ".img_EdcEcc.txt"))
errorCount = GetErrorCount(basePath + ".img_EdcEcc.txt");
else if (File.Exists(basePath + ".img_EccEdc.txt"))
errorCount = GetErrorCount(basePath + ".img_EccEdc.txt");
// Audio-only discs will fail if there are any C2 errors, so they would never get here
if (audioOnly)
{
info.CommonDiscInfo.ErrorsCount = "0";
}
else
{
long errorCount = -1;
if (File.Exists(basePath + ".img_EdcEcc.txt"))
errorCount = GetErrorCount(basePath + ".img_EdcEcc.txt");
else if (File.Exists(basePath + ".img_EccEdc.txt"))
errorCount = GetErrorCount(basePath + ".img_EccEdc.txt");
info.CommonDiscInfo.ErrorsCount = (errorCount == -1 ? "Error retrieving error count" : errorCount.ToString());
}
info.CommonDiscInfo.ErrorsCount = (errorCount == -1 ? "Error retrieving error count" : errorCount.ToString());
info.TracksAndWriteOffsets.Cuesheet = GetFullFile(basePath + ".cue") ?? "";
string cdWriteOffset = GetWriteOffset(basePath + "_disc.txt") ?? "";