diff --git a/MPF.Library/Aaru/Parameters.cs b/MPF.Library/Aaru/Parameters.cs
index 02a08d5e..34df338a 100644
--- a/MPF.Library/Aaru/Parameters.cs
+++ b/MPF.Library/Aaru/Parameters.cs
@@ -1496,8 +1496,6 @@ namespace MPF.Aaru
case MediaType.DVD:
case MediaType.HDDVD:
case MediaType.BluRay:
- bool xgd = (this.System == KnownSystem.MicrosoftXBOX || this.System == KnownSystem.MicrosoftXBOX360);
-
// Get the individual hash data, as per internal
if (GetISOHashValues(info.TracksAndWriteOffsets.ClrMameProData, out long size, out string crc32, out string md5, out string sha1))
{
diff --git a/MPF.Library/DiscImageCreator/Parameters.cs b/MPF.Library/DiscImageCreator/Parameters.cs
index fc733b49..e7b617e8 100644
--- a/MPF.Library/DiscImageCreator/Parameters.cs
+++ b/MPF.Library/DiscImageCreator/Parameters.cs
@@ -1849,8 +1849,6 @@ namespace MPF.DiscImageCreator
case MediaType.DVD:
case MediaType.HDDVD:
case MediaType.BluRay:
- bool xgd = (this.System == KnownSystem.MicrosoftXBOX || this.System == KnownSystem.MicrosoftXBOX360);
-
// Get the individual hash data, as per internal
if (GetISOHashValues(info.TracksAndWriteOffsets.ClrMameProData, out long size, out string crc32, out string md5, out string sha1))
{
@@ -1863,7 +1861,7 @@ namespace MPF.DiscImageCreator
// Deal with the layerbreaks
if (this.Type == MediaType.DVD)
{
- string layerbreak = GetLayerbreak(basePath + "_disc.txt", xgd) ?? "";
+ string layerbreak = GetLayerbreak(basePath + "_disc.txt", System.IsXGD()) ?? "";
info.SizeAndChecksums.Layerbreak = !string.IsNullOrEmpty(layerbreak) ? Int64.Parse(layerbreak) : default;
}
else if (this.Type == MediaType.BluRay)
@@ -1879,11 +1877,6 @@ namespace MPF.DiscImageCreator
if (layerbreak3 != null && layerbreak3 * 2048 < info.SizeAndChecksums.Size)
info.SizeAndChecksums.Layerbreak3 = layerbreak3.Value;
}
- else
- {
- string layerbreak = GetLayerbreak(basePath + "_disc.txt", xgd) ?? "";
- info.SizeAndChecksums.Layerbreak = !string.IsNullOrEmpty(layerbreak) ? Int64.Parse(layerbreak) : default;
- }
}
// Read the PVD
diff --git a/MPF.Library/Utilities/Extensions.cs b/MPF.Library/Utilities/Extensions.cs
index 21909574..850dd591 100644
--- a/MPF.Library/Utilities/Extensions.cs
+++ b/MPF.Library/Utilities/Extensions.cs
@@ -91,5 +91,24 @@ namespace MPF.Utilities
return false;
}
}
+
+ ///
+ /// Determine if a system is considered XGD
+ ///
+ /// KnownSystem value to check
+ /// True if the system is XGD, false otherwise
+ public static bool IsXGD(this KnownSystem? system)
+ {
+ switch (system)
+ {
+ case KnownSystem.MicrosoftXBOX:
+ case KnownSystem.MicrosoftXBOX360:
+ case KnownSystem.MicrosoftXBOXOne:
+ case KnownSystem.MicrosoftXboxSeriesXS:
+ return true;
+ default:
+ return false;
+ }
+ }
}
}