Simplify conditionals
This commit is contained in:
+3
-24
@@ -667,16 +667,9 @@ namespace LibIRD
|
|||||||
{
|
{
|
||||||
bool titleIDFound = paramSFO.Field.TryGetValue("TITLE_ID", out string titleID);
|
bool titleIDFound = paramSFO.Field.TryGetValue("TITLE_ID", out string titleID);
|
||||||
if (titleIDFound)
|
if (titleIDFound)
|
||||||
{
|
TitleID = titleID.Length == 9 ? titleID : titleID.PadRight(9, '\0')[..9];
|
||||||
if (titleID.Length == 9)
|
|
||||||
TitleID = titleID;
|
|
||||||
else
|
|
||||||
TitleID = titleID.PadRight(9, '\0')[..9];
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
TitleID = "\0\0\0\0\0\0\0\0\0";
|
TitleID = "\0\0\0\0\0\0\0\0\0";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try use Title from PARAM.SFO
|
// Try use Title from PARAM.SFO
|
||||||
@@ -688,31 +681,17 @@ namespace LibIRD
|
|||||||
{
|
{
|
||||||
bool discVersionFound = paramSFO.Field.TryGetValue("VERSION", out string discVersion);
|
bool discVersionFound = paramSFO.Field.TryGetValue("VERSION", out string discVersion);
|
||||||
if (discVersionFound)
|
if (discVersionFound)
|
||||||
{
|
DiscVersion = discVersion.Length == 5 ? discVersion : discVersion.PadRight(5, '\0')[..5];
|
||||||
if (discVersion.Length == 5)
|
|
||||||
DiscVersion = discVersion;
|
|
||||||
else
|
|
||||||
DiscVersion = discVersion.PadRight(5, '\0')[..5];
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
DiscVersion = "\0\0\0\0\0";
|
DiscVersion = "\0\0\0\0\0";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try use App Version from PARAM.SFO
|
// Try use App Version from PARAM.SFO
|
||||||
bool appVersionFound = paramSFO.Field.TryGetValue("APP_VER", out string appVersion);
|
bool appVersionFound = paramSFO.Field.TryGetValue("APP_VER", out string appVersion);
|
||||||
if (appVersionFound)
|
if (appVersionFound)
|
||||||
{
|
AppVersion = appVersion.Length == 5 ? appVersion : appVersion.PadRight(5, '\0')[..5];
|
||||||
if (appVersion.Length == 5)
|
|
||||||
AppVersion = appVersion;
|
|
||||||
else
|
|
||||||
AppVersion = appVersion.PadRight(5, '\0')[..5];
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
AppVersion = "\0\0\0\0\0";
|
AppVersion = "\0\0\0\0\0";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine system update version
|
// Determine system update version
|
||||||
|
|||||||
Reference in New Issue
Block a user