From 5612d7989dfadb62091a407d4c0f2eff0e82b854 Mon Sep 17 00:00:00 2001 From: Deterous <138427222+Deterous@users.noreply.github.com> Date: Tue, 20 May 2025 00:54:37 +0900 Subject: [PATCH] Relax PS3CFW output filename requirements (#848) * Relax PS3CFW output filename requirements * don't use Linq * better regex * literal backslash * requested changes * fix * Update MPF.Processors/PS3CFW.cs Co-authored-by: Matt Nadareski --------- Co-authored-by: Matt Nadareski --- CHANGELIST.md | 1 + MPF.Processors/PS3CFW.cs | 16 ++++++++++++++-- MPF.Processors/XboxBackupCreator.cs | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index c5c9e52e..8e5f7020 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -53,6 +53,7 @@ - Add newlines to pkg info printing - Better audio-only check - Minor cleanup from last commit +- Relax PS3CFW output filename requirements ### 3.3.0 (2025-01-03) diff --git a/MPF.Processors/PS3CFW.cs b/MPF.Processors/PS3CFW.cs index 6727f59a..6ff2a8ca 100644 --- a/MPF.Processors/PS3CFW.cs +++ b/MPF.Processors/PS3CFW.cs @@ -61,6 +61,12 @@ namespace MPF.Processors getKeyPath = $"{basePath}.getkey.log"; else if (File.Exists(Path.Combine(baseDir, "getkey.log"))) getKeyPath = Path.Combine(baseDir, "getkey.log"); + else + { + string[] getKeyFiles = Directory.GetFiles(baseDir, "*.getkey.log"); + if (getKeyFiles.Length > 0) + getKeyPath = getKeyFiles[0]; + } // Get dumping date from GetKey log date if (!string.IsNullOrEmpty(getKeyPath)) @@ -71,6 +77,12 @@ namespace MPF.Processors info.Extras!.PIC = GetPIC($"{basePath}.disc.pic", 264); else if (File.Exists(Path.Combine(baseDir, "disc.pic"))) info.Extras!.PIC = GetPIC(Path.Combine(baseDir, "disc.pic"), 264); + else + { + string[] discPicFiles = Directory.GetFiles(baseDir, "*.disc.pic"); + if (discPicFiles.Length > 0) + info.Extras!.PIC = GetPIC(discPicFiles[0], 264); + } // Parse Disc Key, Disc ID, and PIC from the getkey.log file if (ProcessingTool.ParseGetKeyLog(getKeyPath, out string? key, out string? id, out string? pic)) @@ -96,11 +108,11 @@ namespace MPF.Processors return [ new([$"{outputFilename}.iso", $"{outputFilename}.ISO"], OutputFileFlags.Required), new([$"{outputFilename}.cue", $"{outputFilename}.CUE"], OutputFileFlags.Zippable), - new([$"{outputFilename}.getkey.log", "getkey.log"], OutputFileFlags.Required + new RegexOutputFile($"getkey\\.log$", OutputFileFlags.Required | OutputFileFlags.Artifact | OutputFileFlags.Zippable, "getkey_log"), - new([$"{outputFilename}.disc.pic", "disc.pic"], OutputFileFlags.Required + new RegexOutputFile($"disc\\.pic$", OutputFileFlags.Required | OutputFileFlags.Binary | OutputFileFlags.Zippable, "disc_pic"), diff --git a/MPF.Processors/XboxBackupCreator.cs b/MPF.Processors/XboxBackupCreator.cs index effcc5c4..7ce965a2 100644 --- a/MPF.Processors/XboxBackupCreator.cs +++ b/MPF.Processors/XboxBackupCreator.cs @@ -165,7 +165,7 @@ namespace MPF.Processors | OutputFileFlags.Binary | OutputFileFlags.Zippable, "dmi"), - new RegexOutputFile("[lL]og.txt", OutputFileFlags.Required + new RegexOutputFile("[lL]og\\.txt", OutputFileFlags.Required | OutputFileFlags.Artifact | OutputFileFlags.Zippable, "log"),