Normalize Redumper CSS outputs

This commit is contained in:
Matt Nadareski
2023-06-19 21:13:18 -04:00
parent 8695d2981e
commit 83ea04c880
2 changed files with 16 additions and 1 deletions

View File

@@ -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)

View File

@@ -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();
}