From 83ea04c88007e6caddd0a8aa9c36b4bb5601fa97 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 19 Jun 2023 21:13:18 -0400 Subject: [PATCH] Normalize Redumper CSS outputs --- CHANGELIST.md | 1 + MPF.Modules/Redumper/Parameters.cs | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index c2d4e794..1f23847a 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -75,6 +75,7 @@ - Add support for redumper CD synonyms - Adjust CSS title key parsing - Fix non-reading loop +- Normalize Redumper CSS outputs ### 2.5 (2023-03-12) diff --git a/MPF.Modules/Redumper/Parameters.cs b/MPF.Modules/Redumper/Parameters.cs index 86b4a651..a8062347 100644 --- a/MPF.Modules/Redumper/Parameters.cs +++ b/MPF.Modules/Redumper/Parameters.cs @@ -1246,6 +1246,8 @@ namespace MPF.Modules.Redumper if (line.StartsWith("protection system type")) { copyrightProtectionSystemType = line.Substring("protection system type: ".Length); + if (copyrightProtectionSystemType == "none") + copyrightProtectionSystemType = "No"; } else if (line.StartsWith("region management information:")) { @@ -1264,13 +1266,25 @@ namespace MPF.Modules.Redumper { var match = Regex.Match(line, @"^(.*?): (.*?)$"); if (match.Success) - vobKeys += $"{match.Groups[1].Value} Title Key: {match.Groups[2].Value}\n"; + { + string normalizedKey = match.Groups[2].Value.Replace(':', ' '); + if (normalizedKey == "none") + normalizedKey = "No Title Key"; + + vobKeys += $"{match.Groups[1].Value} Title Key: {match.Groups[2].Value.Replace(':', ' ')}\n"; + } else + { break; + } line = sr.ReadLine()?.Trim(); } } + else + { + break; + } line = sr.ReadLine()?.Trim(); }