Cap X360 directory check to 500MB (fixes #362)

This commit is contained in:
Matt Nadareski
2022-02-11 12:59:37 -08:00
parent 98f77eca07
commit ed26e6611a
2 changed files with 8 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
- Fix DVD layer finding corner case
- Fix failing module tests
- Add option to limit region and language selections
- Cap X360 directory check to 500MB
### 2.3 (2022-02-05)
- Start overhauling Redump information pulling, again

View File

@@ -45,6 +45,11 @@ namespace MPF.Core.Data
/// </summary>
public bool MarkedActive => driveInfo?.IsReady ?? false;
/// <summary>
/// Represents the total size of the drive
/// </summary>
public long TotalSize => driveInfo?.TotalSize ?? default;
/// <summary>
/// Media label as read by Windows
/// </summary>
@@ -279,7 +284,8 @@ namespace MPF.Core.Data
try
{
if (Directory.Exists(Path.Combine(drivePath, "$SystemUpdate"))
&& Directory.EnumerateFiles(Path.Combine(drivePath, "$SystemUpdate")).Any())
&& Directory.EnumerateFiles(Path.Combine(drivePath, "$SystemUpdate")).Any()
&& this.TotalSize <= 500_000_000)
{
return RedumpSystem.MicrosoftXbox360;
}