mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Fix PS4 autodetect (Fixes #164)
This commit is contained in:
@@ -804,17 +804,17 @@ namespace DICUI.Utilities
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the current system from drive letter
|
||||
/// Get the current system from drive
|
||||
/// </summary>
|
||||
/// <param name="driveLetter"></param>
|
||||
/// <param name="drive"></param>
|
||||
/// <returns></returns>
|
||||
public static KnownSystem? GetKnownSystem(char? driveLetter)
|
||||
public static KnownSystem? GetKnownSystem(Drive drive)
|
||||
{
|
||||
// If no letter is provided, then we can't do anything
|
||||
if (driveLetter == null)
|
||||
// If drive or drive letter are provided, we can't do anything
|
||||
if (drive?.Letter == null)
|
||||
return null;
|
||||
|
||||
string drivePath = $"{driveLetter}:\\";
|
||||
string drivePath = $"{drive.Letter}:\\";
|
||||
|
||||
// If we can't read the media in that drive, we can't do anything
|
||||
if (!Directory.Exists(drivePath))
|
||||
@@ -856,7 +856,7 @@ namespace DICUI.Utilities
|
||||
}
|
||||
|
||||
// Sony PlayStation 4
|
||||
if (File.Exists(Path.Combine(drivePath, "PSLogo.ico")))
|
||||
if (drive.VolumeLabel.Equals("PS4VOLUME", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return KnownSystem.SonyPlayStation4;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ namespace DICUI.Windows
|
||||
if (!_options.SkipSystemDetection && index != -1)
|
||||
{
|
||||
ViewModels.LoggerViewModel.VerboseLog("Trying to detect system for drive {0}.. ", _drives[index].Letter);
|
||||
var currentSystem = Validators.GetKnownSystem(_drives[index].Letter);
|
||||
var currentSystem = Validators.GetKnownSystem(_drives[index]);
|
||||
ViewModels.LoggerViewModel.VerboseLogLn(currentSystem == null || currentSystem == KnownSystem.NONE ? "unable to detect." : ("detected " + currentSystem.LongName() + "."));
|
||||
|
||||
if (currentSystem != null && currentSystem != KnownSystem.NONE)
|
||||
|
||||
Reference in New Issue
Block a user