Ensure volume label is trimmed if used in filenames

This commit is contained in:
Matt Nadareski
2025-11-14 09:14:14 -05:00
parent b1b6eb2c9d
commit f0f41c86c5
4 changed files with 6 additions and 1 deletions

View File

@@ -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)

View File

@@ -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;

View File

@@ -665,6 +665,7 @@ namespace MPF.Frontend.Tools
/// </summary>
/// <param name="original">Source dictionary to add to</param>
/// <param name="add">Second dictionary to add from</param>
/// TODO: Remove from here when IO is updated
private static void MergeDictionaries(Dictionary<string, List<string>> original, Dictionary<string, List<string>> add)
{
// Ignore if there are no values to append

View File

@@ -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: