From de18609e0010fdac6510feccda6db7f398e200da Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 20 Jan 2023 22:55:13 -0800 Subject: [PATCH] Add drive format (fs) to log --- CHANGELIST.md | 1 + MPF.Core/Data/Drive.cs | 12 ++++++++++++ MPF/ViewModels/MainViewModel.cs | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 5769abd6..f59d74d6 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -39,6 +39,7 @@ - Use msbuild for .NET Framework 4.8 - Update nuget packages - ReadAllText not ReadAllLines +- Add drive format (fs) to log ### 2.4 (2022-10-26) - Update to DIC 20211001 diff --git a/MPF.Core/Data/Drive.cs b/MPF.Core/Data/Drive.cs index 294c29e3..932c493e 100644 --- a/MPF.Core/Data/Drive.cs +++ b/MPF.Core/Data/Drive.cs @@ -491,6 +491,18 @@ namespace MPF.Core.Data #region Helpers + /// + /// Get the media type for a device path + /// + /// MediaType, null on error + private (MediaType?, string) GetMediaTypeFromFilesystemName() + { + switch (this.DriveFormat) + { + default: return (null, $"Unrecognized format: {this.DriveFormat}"); + } + } + #if NETFRAMEWORK /// diff --git a/MPF/ViewModels/MainViewModel.cs b/MPF/ViewModels/MainViewModel.cs index bd1fc314..2428e6d3 100644 --- a/MPF/ViewModels/MainViewModel.cs +++ b/MPF/ViewModels/MainViewModel.cs @@ -850,7 +850,7 @@ namespace MPF.UI.ViewModels // If the drive is marked active, try to read from it else if (drive.MarkedActive) { - App.Logger.VerboseLog($"Trying to detect media type for drive {drive.Letter}.. "); + App.Logger.VerboseLog($"Trying to detect media type for drive {drive.Letter} [{drive.DriveFormat}].. "); (MediaType? detectedMediaType, string errorMessage) = drive.GetMediaType(); // If we got an error message, post it to the log