diff --git a/CHANGELIST.md b/CHANGELIST.md index d421469c..5daed0cc 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -9,6 +9,7 @@ - Support ringcode and PIC for triple/quad-layer (fuzz6001) - Cleanup !protectionInfo.txt (Deterous) - Update Redumper to build 311 (Deterous) +- Use PSX/PS2 serial as filename when Volume Label not present (Deterous) ### 3.0.3 (2023-12-04) diff --git a/MPF.Core/Data/Drive.cs b/MPF.Core/Data/Drive.cs index 42d901b3..e2bda944 100644 --- a/MPF.Core/Data/Drive.cs +++ b/MPF.Core/Data/Drive.cs @@ -58,18 +58,34 @@ namespace MPF.Core.Data /// /// Media label as read by Windows, formatted to avoid odd outputs + /// If no volume label present, use PSX or PS2 serial if valid + /// Otherwise, use "track" as volume label /// public string? FormattedVolumeLabel { get { string? volumeLabel = Template.DiscNotDetected; - if (this.MarkedActive) + if (!this.MarkedActive) + return volumeLabel; + + if (!string.IsNullOrEmpty(this.VolumeLabel)) + volumeLabel = this.VolumeLabel; + else { - if (string.IsNullOrEmpty(this.VolumeLabel)) - volumeLabel = "track"; - else - volumeLabel = this.VolumeLabel; + // No Volume Label found, fallback to something sensible + switch (this.GetRedumpSystem(null)) + { + case RedumpSystem.SonyPlayStation: + case RedumpSystem.SonyPlayStation2: + InfoTool.GetPlayStationExecutableInfo(this.Name, out string? serial, out _, out _); + volumeLabel = serial ?? "track"; + break; + + default: + volumeLabel = "track"; + break; + } } foreach (char c in Path.GetInvalidFileNameChars())