mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Fix log line for default system use
This commit is contained in:
@@ -111,6 +111,7 @@
|
||||
- Separate params checkbox from input
|
||||
- Disable more UI elements when editing
|
||||
- Ensure parameters checkbox is enabled to start
|
||||
- Fix log line for default system use
|
||||
|
||||
### 3.2.4 (2024-11-24)
|
||||
|
||||
|
||||
@@ -1263,8 +1263,9 @@ namespace MPF.Frontend.ViewModels
|
||||
else if (!Options.SkipSystemDetection)
|
||||
{
|
||||
VerboseLog($"Trying to detect system for drive {CurrentDrive.Name}.. ");
|
||||
var currentSystem = GetRedumpSystem(CurrentDrive, Options.DefaultSystem) ?? Options.DefaultSystem;
|
||||
VerboseLogLn(currentSystem == null ? "unable to detect." : ($"detected {currentSystem.LongName()}."));
|
||||
var currentSystem = GetRedumpSystem(CurrentDrive);
|
||||
VerboseLogLn(currentSystem == null ? $"unable to detect, defaulting to {Options.DefaultSystem.LongName()}" : ($"detected {currentSystem.LongName()}."));
|
||||
currentSystem ??= Options.DefaultSystem;
|
||||
|
||||
if (currentSystem != null)
|
||||
{
|
||||
@@ -1462,17 +1463,15 @@ namespace MPF.Frontend.ViewModels
|
||||
/// <summary>
|
||||
/// Get the current system from drive
|
||||
/// </summary>
|
||||
/// <param name="defaultValue"></param>
|
||||
/// <returns></returns>
|
||||
private static RedumpSystem? GetRedumpSystem(Drive? drive, RedumpSystem? defaultValue)
|
||||
private static RedumpSystem? GetRedumpSystem(Drive? drive)
|
||||
{
|
||||
// If the drive does not exist, we can't do anything
|
||||
if (drive == null)
|
||||
return defaultValue;
|
||||
return null;
|
||||
|
||||
// If we can't read the media in that drive, we can't do anything
|
||||
if (string.IsNullOrEmpty(drive.Name) || !Directory.Exists(drive.Name))
|
||||
return defaultValue;
|
||||
return null;
|
||||
|
||||
// We're going to assume for floppies, HDDs, and removable drives
|
||||
if (drive.InternalDriveType != InternalDriveType.Optical)
|
||||
@@ -1756,7 +1755,7 @@ namespace MPF.Frontend.ViewModels
|
||||
#endregion
|
||||
|
||||
// Default return
|
||||
return defaultValue;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1873,7 +1872,7 @@ namespace MPF.Frontend.ViewModels
|
||||
else
|
||||
{
|
||||
// No Volume Label found, fallback to something sensible
|
||||
switch (GetRedumpSystem(drive, null))
|
||||
switch (GetRedumpSystem(drive))
|
||||
{
|
||||
case RedumpSystem.SonyPlayStation:
|
||||
case RedumpSystem.SonyPlayStation2:
|
||||
|
||||
Reference in New Issue
Block a user