Use deterministic filenames for synthesised PSX `.cue`s

resolves #4146
This commit is contained in:
YoshiRulz 2025-01-05 21:24:09 +10:00
parent 7514ea73c7
commit 04955ea228
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 2 additions and 1 deletions

View File

@ -487,7 +487,8 @@ namespace BizHawk.Client.Common
break;
case VSystemID.Raw.PSX when ext is ".bin":
const string FILE_EXT_CUE = ".cue";
var cuePath = TempFileManager.GetTempFilename(friendlyName: "syn", dotAndExtension: FILE_EXT_CUE, delete: false);
var crc32Digest = CRC32Checksum.ComputeDigestHex(file.GetStream().ReadAllBytes()); // slow!
var cuePath = Path.Combine(Path.GetTempPath(), $"synthesised for {crc32Digest}{FILE_EXT_CUE}");
DiscMountJob.CreateSyntheticCue(cueFilePath: cuePath, binFilePath: file.Name);
var gameBak = game;
var nextEmulatorBak = nextEmulator;