diff --git a/CHANGELIST.md b/CHANGELIST.md index 5e72ce0c..99ae0d3f 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -20,6 +20,7 @@ - Update RedumpLib to 1.7.1 - Support multisession cache files - Update DIC to 20250901 (Windows/Linux only) +- Fix UIC processing logic ### 3.3.3 (2025-07-18) diff --git a/MPF.Processors.Test/ProcessingToolTests.cs b/MPF.Processors.Test/ProcessingToolTests.cs index d6efb2d4..337bf408 100644 --- a/MPF.Processors.Test/ProcessingToolTests.cs +++ b/MPF.Processors.Test/ProcessingToolTests.cs @@ -471,12 +471,9 @@ namespace MPF.Processors.Test [Theory] [InlineData(null, null)] [InlineData("", null)] - [InlineData("GAME", DiscCategory.Games)] - [InlineData("game", DiscCategory.Games)] - [InlineData("VIDEO", DiscCategory.Video)] - [InlineData("video", DiscCategory.Video)] - [InlineData("AUDIO", DiscCategory.Audio)] - [InlineData("audio", DiscCategory.Audio)] + [InlineData("(GAME)", DiscCategory.Games)] + [InlineData("(VIDEO)", DiscCategory.Video)] + [InlineData("(AUDIO)", DiscCategory.Audio)] [InlineData("INVALID", null)] public void GetUMDCategoryTest(string? category, DiscCategory? expected) { diff --git a/MPF.Processors.Test/TestData/UmdImageCreator/UMD-zip/test_logs.zip b/MPF.Processors.Test/TestData/UmdImageCreator/UMD-zip/test_logs.zip index a84e00ef..c2838830 100644 Binary files a/MPF.Processors.Test/TestData/UmdImageCreator/UMD-zip/test_logs.zip and b/MPF.Processors.Test/TestData/UmdImageCreator/UMD-zip/test_logs.zip differ diff --git a/MPF.Processors.Test/TestData/UmdImageCreator/UMD/test_disc.txt b/MPF.Processors.Test/TestData/UmdImageCreator/UMD/test_disc.txt index bcea7b94..258ce697 100644 --- a/MPF.Processors.Test/TestData/UmdImageCreator/UMD/test_disc.txt +++ b/MPF.Processors.Test/TestData/UmdImageCreator/UMD/test_disc.txt @@ -1,7 +1,21 @@ << GetUMDAuxInfo >> -TITLE title -DISC_ID serial -DISC_VERSION version -pspUmdTypes GAME -L0 length 12345 -FileSize: 12345 +disc0:/PSP_GAME/PARAM.SFO + magic: PSF + version: 1.01 + BOOTABLE: 1 + CATEGORY: UG + DISC_ID: ABCD12345 + DISC_NUMBER: 1 + DISC_TOTAL: 1 + DISC_VERSION: 1.01 + PARENTAL_LEVEL: 1 + PSP_SYSTEM_VER: 1.00 + REGION: 32768 + TITLE: title + +pspUmdTypes: 0x10 (GAME) + L0 length: 442560 (0x6c0c0) + L1 length: 276096 (0x43680) + --------------------------- + Total: 718656 (0xaf740) + FileSize: 1471807488 (0x57ba0000) diff --git a/MPF.Processors.Test/UmdImageCreatorTests.cs b/MPF.Processors.Test/UmdImageCreatorTests.cs index a7de6bea..ae7735b4 100644 --- a/MPF.Processors.Test/UmdImageCreatorTests.cs +++ b/MPF.Processors.Test/UmdImageCreatorTests.cs @@ -291,10 +291,10 @@ namespace MPF.Processors.Test { string? expectedTitle = "title"; DiscCategory? expectedCategory = DiscCategory.Games; - string? expectedSerial = "seri-al"; - string? expectedVersion = "version"; - string? expectedLayer = "12345"; - long expectedSize = 12345; + string? expectedSerial = "ABCD-12345"; + string? expectedVersion = "1.01"; + string? expectedLayer = "442560"; + long expectedSize = 1471807488; string disc = Path.Combine(Environment.CurrentDirectory, "TestData", "UmdImageCreator", "UMD", "test_disc.txt"); bool actual = UmdImageCreator.GetUMDAuxInfo(disc, diff --git a/MPF.Processors/ProcessingTool.cs b/MPF.Processors/ProcessingTool.cs index c5f6bc9f..e62fe985 100644 --- a/MPF.Processors/ProcessingTool.cs +++ b/MPF.Processors/ProcessingTool.cs @@ -375,9 +375,9 @@ namespace MPF.Processors { return category?.ToLowerInvariant() switch { - "game" => DiscCategory.Games, - "video" => DiscCategory.Video, - "audio" => DiscCategory.Audio, + "(game)" => DiscCategory.Games, + "(video)" => DiscCategory.Video, + "(audio)" => DiscCategory.Audio, _ => null, }; } diff --git a/MPF.Processors/UmdImageCreator.cs b/MPF.Processors/UmdImageCreator.cs index c2b743c9..2cd37b13 100644 --- a/MPF.Processors/UmdImageCreator.cs +++ b/MPF.Processors/UmdImageCreator.cs @@ -184,13 +184,13 @@ namespace MPF.Processors break; if (line.StartsWith("TITLE") && title == null) - title = line.Split(' ')[1]; + title = line.Substring("TITLE: ".Length); else if (line.StartsWith("DISC_ID") && version == null) serial = line.Split(' ')[1]; else if (line.StartsWith("DISC_VERSION") && version == null) version = line.Split(' ')[1]; else if (line.StartsWith("pspUmdTypes")) - category = ProcessingTool.GetUMDCategory(line.Split(' ')[1]); + category = ProcessingTool.GetUMDCategory(line.Split(' ')[2]); else if (line.StartsWith("L0 length")) layer = line.Split(' ')[2]; else if (line.StartsWith("FileSize:"))