fix?
This commit is contained in:
parent
1d9af895d7
commit
70fe9bfae8
2 changed files with 9 additions and 10 deletions
|
@ -138,17 +138,17 @@ namespace CreamInstaller
|
|||
if (Program.Canceled) return;
|
||||
List<Task> dlcTasks = new();
|
||||
List<int> dlcIds = new();
|
||||
if (!(appInfo is null) && !(appInfo.Value is VValue))
|
||||
if (!(appInfo is null))
|
||||
{
|
||||
if (!(appInfo.Value["extended"] is null) && !(appInfo.Value["extended"] is VValue))
|
||||
if (!(appInfo.Value["extended"] is null))
|
||||
foreach (VProperty property in appInfo.Value["extended"])
|
||||
if (property.Key.ToString() == "listofdlc")
|
||||
foreach (string id in property.Value.ToString().Split(","))
|
||||
if (!dlcIds.Contains(int.Parse(id)))
|
||||
dlcIds.Add(int.Parse(id));
|
||||
if (!(appInfo.Value["depots"] is null) && !(appInfo.Value["depots"] is VValue))
|
||||
if (!(appInfo.Value["depots"] is null))
|
||||
foreach (VProperty _property in appInfo.Value["depots"])
|
||||
if (int.TryParse(_property.Key.ToString(), out int _) && !(_property.Value is VValue))
|
||||
if (int.TryParse(_property.Key.ToString(), out int _))
|
||||
if (int.TryParse(_property.Value?["dlcappid"]?.ToString(), out int appid) && !dlcIds.Contains(appid))
|
||||
dlcIds.Add(appid);
|
||||
}
|
||||
|
|
|
@ -77,15 +77,14 @@ namespace CreamInstaller
|
|||
}
|
||||
if (Program.Canceled || output is null) return false;
|
||||
appInfo = VdfConvert.Deserialize(output);
|
||||
if (appInfo?.Value is VValue || appInfo?.Value?["common"] is VValue) return true;
|
||||
VToken type = appInfo?.Value?["common"]?["type"];
|
||||
if (appInfo?.Value?.Children()?.ToList()?.Count > 0) return true;
|
||||
VToken type = null;
|
||||
try { type = appInfo?.Value?["common"]?["type"]; } catch { }
|
||||
if (type is null || type.ToString() == "Game")
|
||||
{
|
||||
if (appInfo?.Value?["depots"] is VValue) return true;
|
||||
if (appInfo?.Value?["depots"]?["public"] is VValue) return true;
|
||||
string buildid = appInfo?.Value?["depots"]?["public"]?["buildid"]?.ToString();
|
||||
string buildid = null;
|
||||
try { buildid = appInfo.Value["depots"]["public"]["buildid"].ToString(); } catch { }
|
||||
if (buildid is null && !(type is null)) return true;
|
||||
if (appInfo?.Value?.Children()?.ToList()?.Count > 0) return true;
|
||||
if (type is null || int.Parse(buildid?.ToString()) < buildId || appInfo.Value["extended"] is null || appInfo.Value["depots"] is null)
|
||||
{
|
||||
File.Delete(appUpdateFile);
|
||||
|
|
Loading…
Reference in a new issue