diff --git a/CHANGELIST.md b/CHANGELIST.md index 2ab55159..8611d27f 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -71,6 +71,7 @@ - Path scan after image scan - Update Redumper to build 663 - Name some type parameters +- Ensure volume label is trimmed if used in filenames ### 3.5.0 (2025-10-10) diff --git a/MPF.Frontend/Tools/FrontendTool.cs b/MPF.Frontend/Tools/FrontendTool.cs index 3d50cc6e..ac1384f9 100644 --- a/MPF.Frontend/Tools/FrontendTool.cs +++ b/MPF.Frontend/Tools/FrontendTool.cs @@ -49,6 +49,9 @@ namespace MPF.Frontend.Tools if (string.IsNullOrEmpty(volumeLabel)) return null; + // Trim the volume label + volumeLabel = volumeLabel!.Trim(); + // Audio CD if (volumeLabel!.Equals("Audio CD", StringComparison.OrdinalIgnoreCase)) return RedumpSystem.AudioCD; diff --git a/MPF.Frontend/Tools/ProtectionTool.cs b/MPF.Frontend/Tools/ProtectionTool.cs index 47862983..5c6a7149 100644 --- a/MPF.Frontend/Tools/ProtectionTool.cs +++ b/MPF.Frontend/Tools/ProtectionTool.cs @@ -665,6 +665,7 @@ namespace MPF.Frontend.Tools /// /// Source dictionary to add to /// Second dictionary to add from + /// TODO: Remove from here when IO is updated private static void MergeDictionaries(Dictionary> original, Dictionary> add) { // Ignore if there are no values to append diff --git a/MPF.Frontend/ViewModels/MainViewModel.cs b/MPF.Frontend/ViewModels/MainViewModel.cs index 52e55253..36ad2337 100644 --- a/MPF.Frontend/ViewModels/MainViewModel.cs +++ b/MPF.Frontend/ViewModels/MainViewModel.cs @@ -2010,7 +2010,7 @@ namespace MPF.Frontend.ViewModels return DiscNotDetectedValue; // Use internal serials where appropriate - string? volumeLabel = string.IsNullOrEmpty(drive.VolumeLabel) ? null : drive.VolumeLabel; + string? volumeLabel = string.IsNullOrEmpty(drive.VolumeLabel) ? null : drive.VolumeLabel!.Trim(); switch (GetRedumpSystem(drive)) { case RedumpSystem.SonyPlayStation: