From 7fd2562cb545230f8d1268757e265fa113760175 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 18 Apr 2022 12:42:18 -0700 Subject: [PATCH] Add filesystem logging for .NET 6 --- CHANGELIST.md | 1 + MPF.Core/Data/Drive.cs | 10 +++++----- MPF/ViewModels/MainViewModel.cs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 6d593053..1508e96f 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -74,6 +74,7 @@ - .NET 6.0 and Cleanup - Remove .NET Core 3.1 from test project for now - Remove .NET Core 3.1 entirely +- Add filesystem logging for .NET 6 ### 2.3 (2022-02-05) - Start overhauling Redump information pulling, again diff --git a/MPF.Core/Data/Drive.cs b/MPF.Core/Data/Drive.cs index 6d6407ef..5bc02fa7 100644 --- a/MPF.Core/Data/Drive.cs +++ b/MPF.Core/Data/Drive.cs @@ -242,12 +242,12 @@ namespace MPF.Core.Data double dvdMaxSize = 9 * Math.Pow(1024, 3); // Attempt to determine media type by size - if (driveInfo.TotalSize < cdMaxSize) - return (MediaType.CDROM, null); - else if (driveInfo.TotalSize < dvdMaxSize) - return (MediaType.DVD, null); + if (this.TotalSize < cdMaxSize) + return (MediaType.CDROM, $"Detected filesystem: {this.DriveFormat}"); + else if (this.TotalSize < dvdMaxSize) + return (MediaType.DVD, $"Detected filesystem: {this.DriveFormat}"); else - return (MediaType.BluRay, null); + return (MediaType.BluRay, $"Detected filesystem: {this.DriveFormat}"); // TODO: In order to get the disc type, Aaru.Core will need to be included as a // package. Unfortunately, it currently has a conflict with one of the required libraries: diff --git a/MPF/ViewModels/MainViewModel.cs b/MPF/ViewModels/MainViewModel.cs index 3713db7f..e41d50c5 100644 --- a/MPF/ViewModels/MainViewModel.cs +++ b/MPF/ViewModels/MainViewModel.cs @@ -832,7 +832,7 @@ namespace MPF.UI.ViewModels // If we got an error message, post it to the log if (errorMessage != null) - App.Logger.VerboseLogLn($"Error in detecting media type: {errorMessage}"); + App.Logger.VerboseLogLn($"Message from detecting media type: {errorMessage}"); // If we got either an error or no media, default to the current System default if (detectedMediaType == null)