mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Fix default layerbreak output (fixes #601)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
- Try to get PS3 data from SFB
|
||||
- Fix PS3 version finding
|
||||
- Pull PS3 Firmware Version (Deterous)
|
||||
- Fix default layerbreak output
|
||||
|
||||
### 2.7.4 (2023-10-31)
|
||||
|
||||
|
||||
@@ -1630,7 +1630,7 @@ namespace MPF.Core
|
||||
|| (info.CommonDiscInfo?.Media.ToMediaType() != MediaType.BluRay
|
||||
&& info.CommonDiscInfo?.System.IsXGD() == false))
|
||||
{
|
||||
AddIfExists(output, Template.LayerbreakField, (info.SizeAndChecksums?.Layerbreak == default && info.SizeAndChecksums?.Layerbreak != default(long) ? null : info.SizeAndChecksums?.Layerbreak.ToString()), 1);
|
||||
AddIfExists(output, Template.LayerbreakField, info.SizeAndChecksums?.Layerbreak, 1);
|
||||
}
|
||||
|
||||
AddIfExists(output, Template.SizeField, info.SizeAndChecksums?.Size.ToString(), 1);
|
||||
@@ -1980,7 +1980,7 @@ namespace MPF.Core
|
||||
if (value == null)
|
||||
return;
|
||||
|
||||
string prefix = "";
|
||||
string prefix = string.Empty;
|
||||
for (int i = 0; i < indent; i++)
|
||||
prefix += "\t";
|
||||
|
||||
@@ -2041,6 +2041,26 @@ namespace MPF.Core
|
||||
AddIfExists(output, key, string.Join(", ", value), indent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add the properly formatted key and value, if possible
|
||||
/// </summary>
|
||||
/// <param name="output">Output list</param>
|
||||
/// <param name="key">Name of the output key to write</param>
|
||||
/// <param name="value">Name of the output value to write</param>
|
||||
/// <param name="indent">Number of tabs to indent the line</param>
|
||||
private static void AddIfExists(List<string> output, string key, long? value, int indent)
|
||||
{
|
||||
// If there's no valid value to write
|
||||
if (value == null || value == default(long))
|
||||
return;
|
||||
|
||||
string prefix = string.Empty;
|
||||
for (int i = 0; i < indent; i++)
|
||||
prefix += "\t";
|
||||
|
||||
output.Add(prefix + key + ": " + value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add the properly formatted key and value, if possible
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user