Use reasonable default names for PlayStation systems (fixes #866)

This commit is contained in:
Matt Nadareski
2025-06-26 08:30:14 -04:00
parent a4616d139d
commit 4fdf8e5dde
2 changed files with 26 additions and 17 deletions

View File

@@ -20,6 +20,7 @@
- Set some default values for CLI
- Address nullable default value
- Better handling of Xbox/360, redumper build 613
- Use reasonable default names for PlayStation systems
### 3.3.2 (2025-06-12)

View File

@@ -2015,25 +2015,33 @@ namespace MPF.Frontend.ViewModels
if (!drive.MarkedActive)
return volumeLabel;
if (!string.IsNullOrEmpty(drive.VolumeLabel))
// Prefer internal serials over volume labels
switch (GetRedumpSystem(drive))
{
volumeLabel = drive.VolumeLabel;
}
else
{
// No Volume Label found, fallback to something sensible
switch (GetRedumpSystem(drive))
{
case RedumpSystem.SonyPlayStation:
case RedumpSystem.SonyPlayStation2:
string? serial = PhysicalTool.GetPlayStationSerial(drive);
volumeLabel = serial ?? "track";
break;
case RedumpSystem.SonyPlayStation:
case RedumpSystem.SonyPlayStation2:
string? ps12Serial = PhysicalTool.GetPlayStationSerial(drive);
volumeLabel = ps12Serial ?? drive.VolumeLabel ?? "track";
break;
default:
volumeLabel = "track";
break;
}
case RedumpSystem.SonyPlayStation3:
string? ps3Serial = PhysicalTool.GetPlayStation3Serial(drive);
volumeLabel = ps3Serial ?? drive.VolumeLabel ?? "track";
break;
case RedumpSystem.SonyPlayStation4:
string? ps4Serial = PhysicalTool.GetPlayStation4Serial(drive);
volumeLabel = ps4Serial ?? drive.VolumeLabel ?? "track";
break;
case RedumpSystem.SonyPlayStation5:
string? ps5Serial = PhysicalTool.GetPlayStation5Serial(drive);
volumeLabel = ps5Serial ?? drive.VolumeLabel ?? "track";
break;
default:
volumeLabel = drive.VolumeLabel ?? "track";
break;
}
foreach (char c in Path.GetInvalidFileNameChars())