From 56dd49bdbfc153da5dd80c3c7f02faf8cf3d352d Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 27 Mar 2026 13:49:34 -0400 Subject: [PATCH] Allow 3 session multisession discs (fixes #963) --- CHANGELIST.md | 1 + MPF.Processors/Redumper.cs | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 40c7bf66..19e682ab 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -3,6 +3,7 @@ - Display the path being processed in Check since multiple are allowed - Replace method already ported to IO - Read cuesheet from Redumper log, if possible +- Allow 3 session multisession discs ### 3.7.0 (2026-03-20) diff --git a/MPF.Processors/Redumper.cs b/MPF.Processors/Redumper.cs index 5e7aa0af..035cc08f 100644 --- a/MPF.Processors/Redumper.cs +++ b/MPF.Processors/Redumper.cs @@ -1900,6 +1900,7 @@ namespace MPF.Processors /// /// Log file location /// Formatted multisession information, null on error + /// TODO: Make this more generic to any number of sessions internal static string? GetMultisessionInformation(string log) { // If the file doesn't exist, we can't get info from it @@ -1917,7 +1918,7 @@ namespace MPF.Processors return null; // Now that we're at the relevant lines, find the session info - string? firstSession = null, secondSession = null; + string? firstSession = null, secondSession = null, thirdSession = null; while (!sr.EndOfStream) { var line = sr.ReadLine()?.Trim(); @@ -1941,6 +1942,14 @@ namespace MPF.Processors #else secondSession = line.Substring("session 2: ".Length).Trim(); #endif + + // Store the third session range + else if (line.Contains("session 3:")) +#if NETCOREAPP || NETSTANDARD2_1_OR_GREATER + thirdSession = line["session 3: ".Length..].Trim(); +#else + thirdSession = line.Substring("session 3: ".Length).Trim(); +#endif } // If either is blank, we don't have multisession @@ -1948,7 +1957,10 @@ namespace MPF.Processors return null; // Create and return the formatted output - return $"Session 1: {firstSession}\nSession 2: {secondSession}"; + if (!string.IsNullOrEmpty(thirdSession)) + return $"Session 1: {firstSession}\nSession 2: {secondSession}\nSession 3: {thirdSession}"; + else + return $"Session 1: {firstSession}\nSession 2: {secondSession}"; } catch {