Pre-compress all skeletons for multi-track CDs (#915)

* Pre-compress all skeletons for multi-track CDs

* Gate behind file existing

* Full track path

* split

* if base path is root
This commit is contained in:
Deterous
2025-11-06 21:39:41 +09:00
committed by GitHub
parent e96bd21f1d
commit dc90e2609d
2 changed files with 28 additions and 0 deletions

View File

@@ -60,6 +60,7 @@
- Fix issues with path assembly
- Clean up submission info use and log link text
- Update Redumper to build 658
- Pre-compress all skeletons for multi-track CDs
### 3.5.0 (2025-10-10)

View File

@@ -125,6 +125,33 @@ namespace MPF.Processors
if (File.Exists($"{basePath}.state"))
_ = CompressZstandard($"{basePath}.state");
// Pre-compress all skeletons for multi-track CDs
if (File.Exists($"{basePath}.cue"))
{
string[] cueLines = File.ReadAllLines($"{basePath}.cue");
foreach (string cueLine in cueLines)
{
// Skip all non-FILE lines
if (!cueLine.StartsWith("FILE"))
continue;
// Extract the information
var match = Regex.Match(cueLine, @"FILE ""(.*?)"" BINARY");
if (!match.Success || match.Groups.Count == 0)
continue;
// Get the track name from the matches
string trackName = match.Groups[1].Value;
trackName = Path.GetFileNameWithoutExtension(trackName);
string baseDir = Path.GetDirectoryName(basePath) ?? string.Empty;
string trackPath = Path.Combine(baseDir, trackName);
// Compress the skeleton if it exists
if (File.Exists($"{trackPath}.skeleton"))
_ = CompressZstandard($"{trackPath}.skeleton");
}
}
// Extract info based generically on MediaType
switch (mediaType)
{