diff --git a/CHANGELIST.md b/CHANGELIST.md index 8bead650..7cd5e182 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -22,6 +22,7 @@ - Better handling of Xbox/360, redumper build 613 - Use reasonable default names for PlayStation systems - Swap PS1/2 back to original name handling +- Only use serial for PS3/4/5 if no custom volume label ### 3.3.2 (2025-06-12) diff --git a/MPF.Frontend/ViewModels/MainViewModel.cs b/MPF.Frontend/ViewModels/MainViewModel.cs index ea4e405f..c46957d5 100644 --- a/MPF.Frontend/ViewModels/MainViewModel.cs +++ b/MPF.Frontend/ViewModels/MainViewModel.cs @@ -2008,8 +2008,11 @@ namespace MPF.Frontend.ViewModels /// private static string? GetFormattedVolumeLabel(Drive? drive) { + // If the drive is invalid if (drive == null) return null; + + // If the drive is marked as inactive if (!drive.MarkedActive) return DiscNotDetectedValue; @@ -2020,26 +2023,35 @@ namespace MPF.Frontend.ViewModels case RedumpSystem.SonyPlayStation: case RedumpSystem.SonyPlayStation2: string? ps12Serial = PhysicalTool.GetPlayStationSerial(drive); - volumeLabel = volumeLabel ?? ps12Serial ?? "track"; + volumeLabel ??= ps12Serial ?? "track"; break; case RedumpSystem.SonyPlayStation3: string? ps3Serial = PhysicalTool.GetPlayStation3Serial(drive); - volumeLabel = ps3Serial ?? volumeLabel ?? "track"; + if (volumeLabel == "PS3VOLUME") + volumeLabel = ps3Serial ?? volumeLabel ?? "track"; + else + volumeLabel ??= ps3Serial ?? "track"; break; case RedumpSystem.SonyPlayStation4: string? ps4Serial = PhysicalTool.GetPlayStation4Serial(drive); - volumeLabel = ps4Serial ?? volumeLabel ?? "track"; + if (volumeLabel == "PS4VOLUME") + volumeLabel = ps4Serial ?? volumeLabel ?? "track"; + else + volumeLabel ??= ps4Serial ?? "track"; break; case RedumpSystem.SonyPlayStation5: string? ps5Serial = PhysicalTool.GetPlayStation5Serial(drive); - volumeLabel = ps5Serial ?? volumeLabel ?? "track"; + if (volumeLabel == "PS5VOLUME") + volumeLabel = ps5Serial ?? volumeLabel ?? "track"; + else + volumeLabel ??= ps5Serial ?? "track"; break; default: - volumeLabel = volumeLabel ?? "track"; + volumeLabel ??= "track"; break; } @@ -2171,7 +2183,7 @@ namespace MPF.Frontend.ViewModels { // Ask user to confirm before exiting application during a dump AskBeforeQuit = true; - + // One last check to determine environment, just in case _environment = DetermineEnvironment();