rewrite mounted bdvd path check

This commit is contained in:
13xforever
2025-11-15 23:17:44 +05:00
parent c7f7a6026d
commit 90fbaab223
2 changed files with 5 additions and 4 deletions

View File

@@ -14,9 +14,9 @@ public static class PathUtils
do
{
segment = Path.GetFileName(path);
result.Add(string.IsNullOrEmpty(segment) ? path : segment);
result.Add(segment is {Length: >0} ? segment : path);
path = Path.GetDirectoryName(path);
} while (!string.IsNullOrEmpty(segment) && !string.IsNullOrEmpty(path));
} while (segment is {Length: >0} && path is {Length: >0});
result.Reverse();
return result.ToArray();
}

View File

@@ -118,8 +118,9 @@ internal static partial class LogParserResult
notes.Add($"⚠️ Retail game booted directly through `{Path.GetFileName(elfBootPath)}`, which is not recommended");
if (items["mounted_dev_bdvd"] is { Length: > 0 } mountedBdvd
&& items["os_type"] is {Length: >0} osType
&& (osType is "Windows" && mountedBdvd.TrimEnd('/').EndsWith(':')
|| osType is "MacOS" && mountedBdvd.StartsWith("/Volumes/")))
&& mountedBdvd.Split('/', StringSplitOptions.RemoveEmptyEntries) is {Length: <3} segments
&& (osType is "Windows" && segments is [[_, ':']]
|| osType is "MacOS" && segments is ["Volumes", _]))
{
notes.Add("⚠️ Booting directly from blu-ray disc is not supported, please make a proper game dump");
}