From 4fdf8e5ddeec989b1f792d8965a9d352e2f56c5b Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 26 Jun 2025 08:30:14 -0400 Subject: [PATCH] Use reasonable default names for PlayStation systems (fixes #866) --- CHANGELIST.md | 1 + MPF.Frontend/ViewModels/MainViewModel.cs | 42 ++++++++++++++---------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 7175e2a7..cda47928 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -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) diff --git a/MPF.Frontend/ViewModels/MainViewModel.cs b/MPF.Frontend/ViewModels/MainViewModel.cs index 04e1dcdb..b8adc755 100644 --- a/MPF.Frontend/ViewModels/MainViewModel.cs +++ b/MPF.Frontend/ViewModels/MainViewModel.cs @@ -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())