From 08c26fab9b2e2bacb6a25946b53014923424641c Mon Sep 17 00:00:00 2001 From: Deterous <138427222+Deterous@users.noreply.github.com> Date: Sat, 28 Dec 2024 12:03:38 +0900 Subject: [PATCH 1/5] Add pure-getkey output names for PS3CFW --- CHANGELIST.md | 1 + MPF.Processors/PS3CFW.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index cd0438c5a..2ceb6d8dd 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -142,6 +142,7 @@ - Reenable XGD1 PVD reporting - Improve PS4/PS5 parsing - Don't add special field keys with no reason +- Add pure-getkey output names for PS3CFW ### 3.2.4 (2024-11-24) diff --git a/MPF.Processors/PS3CFW.cs b/MPF.Processors/PS3CFW.cs index 6837a25af..9d7e3c1af 100644 --- a/MPF.Processors/PS3CFW.cs +++ b/MPF.Processors/PS3CFW.cs @@ -79,11 +79,11 @@ internal override List GetOutputFiles(string? baseDirectory, string case MediaType.BluRay: return [ new($"{baseFilename}.iso", OutputFileFlags.Required), - new($"{baseFilename}.getkey.log", OutputFileFlags.Required + new([$"{baseFilename}.getkey.log", "getkey.log"], OutputFileFlags.Required | OutputFileFlags.Artifact | OutputFileFlags.Zippable, "getkey_log"), - new($"{baseFilename}.disc.pic", OutputFileFlags.Required + new([$"{baseFilename}.disc.pic", "disc.pic"], OutputFileFlags.Required | OutputFileFlags.Binary | OutputFileFlags.Zippable, "disc_pic"), From abe3b91988bae3096000256f85a951dce2999523 Mon Sep 17 00:00:00 2001 From: Deterous <138427222+Deterous@users.noreply.github.com> Date: Sat, 28 Dec 2024 12:07:32 +0900 Subject: [PATCH 2/5] Don't assume . prefix for getkey.log --- MPF.Processors/PS3CFW.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/MPF.Processors/PS3CFW.cs b/MPF.Processors/PS3CFW.cs index 9d7e3c1af..0a3dd77ae 100644 --- a/MPF.Processors/PS3CFW.cs +++ b/MPF.Processors/PS3CFW.cs @@ -48,19 +48,19 @@ public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath // Try to determine the name of the GetKey file(s) string? getKeyBasePath = GetCFWBasePath(basePath); - // If GenerateSubmissionInfo is run, .getkey.log existence should already be checked - if (!File.Exists(getKeyBasePath + ".getkey.log")) + // If GenerateSubmissionInfo is run, getkey.log existence should already be checked + if (!File.Exists(getKeyBasePath + "getkey.log")) return; // Get dumping date from GetKey log date - info.DumpingInfo.DumpingDate = ProcessingTool.GetFileModifiedDate(getKeyBasePath + ".getkey.log")?.ToString("yyyy-MM-dd HH:mm:ss"); + info.DumpingInfo.DumpingDate = ProcessingTool.GetFileModifiedDate(getKeyBasePath + "getkey.log")?.ToString("yyyy-MM-dd HH:mm:ss"); // TODO: Put info about abnormal PIC info beyond 132 bytes in comments? - if (File.Exists(getKeyBasePath + ".disc.pic")) - info.Extras!.PIC = GetPIC(getKeyBasePath + ".disc.pic", 264); + if (File.Exists(getKeyBasePath + "disc.pic")) + info.Extras!.PIC = GetPIC(getKeyBasePath + "disc.pic", 264); - // Parse Disc Key, Disc ID, and PIC from the .getkey.log file - if (ProcessingTool.ParseGetKeyLog(getKeyBasePath + ".getkey.log", out string? key, out string? id, out string? pic)) + // Parse Disc Key, Disc ID, and PIC from the getkey.log file + if (ProcessingTool.ParseGetKeyLog(getKeyBasePath + "getkey.log", out string? key, out string? id, out string? pic)) { if (key != null) info.Extras!.DiscKey = key.ToUpperInvariant(); @@ -133,7 +133,7 @@ internal override List GetOutputFiles(string? baseDirectory, string #region Helper Functions /// - /// Estimate the base filename of the .getkey.log file associated with the dump + /// Estimate the base filename of the getkey.log file associated with the dump /// /// Path to ISO file /// Base filename, null if not found @@ -148,12 +148,12 @@ internal override List GetOutputFiles(string? baseDirectory, string try { string dir = Path.GetDirectoryName(iso) ?? "."; - string[] files = Directory.GetFiles(dir, "*.getkey.log"); + string[] files = Directory.GetFiles(dir, "*getkey.log"); if (files.Length != 1) return null; - return files[0].Substring(0, files[0].Length - 11); + return files[0].Substring(0, files[0].Length - 10); } catch { From 4a897511701fb541511fc2bf3fad741c624246c3 Mon Sep 17 00:00:00 2001 From: Deterous <138427222+Deterous@users.noreply.github.com> Date: Sat, 28 Dec 2024 12:11:02 +0900 Subject: [PATCH 3/5] zip CUE files generated by MultiMAN if they exist --- MPF.Processors/PS3CFW.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/MPF.Processors/PS3CFW.cs b/MPF.Processors/PS3CFW.cs index 0a3dd77ae..5d8e61bdf 100644 --- a/MPF.Processors/PS3CFW.cs +++ b/MPF.Processors/PS3CFW.cs @@ -79,6 +79,7 @@ internal override List GetOutputFiles(string? baseDirectory, string case MediaType.BluRay: return [ new($"{baseFilename}.iso", OutputFileFlags.Required), + new($"{baseFilename}.CUE", OutputFileFlags.Zippable), new([$"{baseFilename}.getkey.log", "getkey.log"], OutputFileFlags.Required | OutputFileFlags.Artifact | OutputFileFlags.Zippable, From 588ff5d7da4387bcd230584c68d8fbceb7141924 Mon Sep 17 00:00:00 2001 From: Deterous <138427222+Deterous@users.noreply.github.com> Date: Sat, 28 Dec 2024 12:20:53 +0900 Subject: [PATCH 4/5] iso and cue can be case sensitive --- MPF.Processors/PS3CFW.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MPF.Processors/PS3CFW.cs b/MPF.Processors/PS3CFW.cs index 5d8e61bdf..4ac3d0749 100644 --- a/MPF.Processors/PS3CFW.cs +++ b/MPF.Processors/PS3CFW.cs @@ -78,8 +78,8 @@ internal override List GetOutputFiles(string? baseDirectory, string { case MediaType.BluRay: return [ - new($"{baseFilename}.iso", OutputFileFlags.Required), - new($"{baseFilename}.CUE", OutputFileFlags.Zippable), + new([$"{baseFilename}.iso", $"{baseFilename}.ISO"], OutputFileFlags.Required), + new([$"{baseFilename}.cue", $"{baseFilename}.CUE"], OutputFileFlags.Zippable), new([$"{baseFilename}.getkey.log", "getkey.log"], OutputFileFlags.Required | OutputFileFlags.Artifact | OutputFileFlags.Zippable, From 87548a3477a11f9680526a1218359441f445f8c0 Mon Sep 17 00:00:00 2001 From: Deterous <138427222+Deterous@users.noreply.github.com> Date: Sat, 28 Dec 2024 12:22:22 +0900 Subject: [PATCH 5/5] Add extra file to cfwps3 tests --- MPF.Processors.Test/PS3CFWTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MPF.Processors.Test/PS3CFWTests.cs b/MPF.Processors.Test/PS3CFWTests.cs index 9f8708bb0..16174a88e 100644 --- a/MPF.Processors.Test/PS3CFWTests.cs +++ b/MPF.Processors.Test/PS3CFWTests.cs @@ -29,7 +29,7 @@ public void GetOutputFiles_BluRay_Populated() var processor = new PS3CFW(RedumpSystem.SonyPlayStation3, MediaType.BluRay); var actual = processor.GetOutputFiles(baseDirectory, baseFilename); - Assert.Equal(3, actual.Count); + Assert.Equal(4, actual.Count); } [Fact]