Conditionally pull region from Redump

This commit is contained in:
Matt Nadareski
2022-01-14 16:30:20 -08:00
parent 9a1815fa1e
commit 1af9e2c2da
2 changed files with 10 additions and 7 deletions

View File

@@ -46,6 +46,7 @@
- Fix Sega CD internal serial reading
- Fix crash on invalid parameters
- Differentiate XMID and XeMID
- Conditionally pull region from Redump
### 2.2 (2021-12-30)
- Fix Saturn header finding

View File

@@ -1373,9 +1373,12 @@ namespace MPF.Library
info.CommonDiscInfo.Category = DiscCategory.Games;
// Region
match = Constants.RegionRegex.Match(discData);
if (match.Success)
info.CommonDiscInfo.Region = Extensions.ToRegion(match.Groups[1].Value);
if (info.CommonDiscInfo.Region == null)
{
match = Constants.RegionRegex.Match(discData);
if (match.Success)
info.CommonDiscInfo.Region = Extensions.ToRegion(match.Groups[1].Value);
}
// Languages
var matches = Constants.LanguagesRegex.Matches(discData);
@@ -1395,11 +1398,10 @@ namespace MPF.Library
// info.CommonDiscInfo.Serial = WebUtility.HtmlDecode(match.Groups[1].Value);
// Error count
match = Constants.ErrorCountRegex.Match(discData);
if (match.Success)
if (string.IsNullOrEmpty(info.CommonDiscInfo.ErrorsCount))
{
// If the error count is empty, fill from the page
if (string.IsNullOrEmpty(info.CommonDiscInfo.ErrorsCount))
match = Constants.ErrorCountRegex.Match(discData);
if (match.Success)
info.CommonDiscInfo.ErrorsCount = match.Groups[1].Value;
}