games use steamCMD fallback

This commit is contained in:
pointfeev 2022-03-08 17:10:08 -05:00
parent d6a2829cbe
commit 0ad6efd7dd
2 changed files with 9 additions and 8 deletions

View file

@ -5,7 +5,7 @@
<UseWindowsForms>True</UseWindowsForms> <UseWindowsForms>True</UseWindowsForms>
<ApplicationIcon>Resources\ini.ico</ApplicationIcon> <ApplicationIcon>Resources\ini.ico</ApplicationIcon>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract> <IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<Version>3.2.1.2</Version> <Version>3.2.2.0</Version>
<PackageIcon>Resources\ini.ico</PackageIcon> <PackageIcon>Resources\ini.ico</PackageIcon>
<PackageIconUrl /> <PackageIconUrl />
<Description /> <Description />

View file

@ -144,7 +144,7 @@ internal partial class SelectForm : CustomForm
} }
AppData appData = await SteamStore.QueryStoreAPI(appId); AppData appData = await SteamStore.QueryStoreAPI(appId);
VProperty appInfo = appInfo = await SteamCMD.GetAppInfo(appId, branch, buildId); VProperty appInfo = appInfo = await SteamCMD.GetAppInfo(appId, branch, buildId);
if (appInfo is null || appData is null) if (appData is null && appInfo is null)
{ {
RemoveFromRemainingGames(name); RemoveFromRemainingGames(name);
return; return;
@ -152,8 +152,9 @@ internal partial class SelectForm : CustomForm
if (Program.Canceled) return; if (Program.Canceled) return;
ConcurrentDictionary<string, (DlcType type, string name, string icon)> dlc = new(); ConcurrentDictionary<string, (DlcType type, string name, string icon)> dlc = new();
List<Task> dlcTasks = new(); List<Task> dlcTasks = new();
List<string> dlcIds = await SteamStore.ParseDlcAppIds(appData); List<string> dlcIds = new();
dlcIds.AddRange(await SteamCMD.ParseDlcAppIds(appInfo)); if (appData is not null) dlcIds.AddRange(await SteamStore.ParseDlcAppIds(appData));
if (appInfo is not null) dlcIds.AddRange(await SteamCMD.ParseDlcAppIds(appInfo));
if (dlcIds.Count > 0) if (dlcIds.Count > 0)
{ {
foreach (string dlcAppId in dlcIds) foreach (string dlcAppId in dlcIds)
@ -209,14 +210,14 @@ internal partial class SelectForm : CustomForm
selection.Enabled = allCheckBox.Checked || selection.SelectedDlc.Any() || selection.ExtraDlc.Any(); selection.Enabled = allCheckBox.Checked || selection.SelectedDlc.Any() || selection.ExtraDlc.Any();
selection.Usable = true; selection.Usable = true;
selection.Id = appId; selection.Id = appId;
selection.Name = appData.name ?? name; selection.Name = appData?.name ?? name;
selection.RootDirectory = directory; selection.RootDirectory = directory;
selection.DllDirectories = dllDirectories; selection.DllDirectories = dllDirectories;
selection.IsSteam = true; selection.IsSteam = true;
selection.ProductUrl = "https://store.steampowered.com/app/" + appId; selection.ProductUrl = "https://store.steampowered.com/app/" + appId;
selection.IconUrl = IconGrabber.SteamAppImagesPath + @$"\{appId}\{appInfo?.Value?.GetChild("common")?.GetChild("icon")?.ToString()}.jpg"; selection.IconUrl = IconGrabber.SteamAppImagesPath + @$"\{appId}\{appInfo?.Value?.GetChild("common")?.GetChild("icon")?.ToString()}.jpg";
selection.SubIconUrl = appData.header_image ?? IconGrabber.SteamAppImagesPath + @$"\{appId}\{appInfo?.Value?.GetChild("common")?.GetChild("clienticon")?.ToString()}.ico"; selection.SubIconUrl = appData?.header_image ?? IconGrabber.SteamAppImagesPath + @$"\{appId}\{appInfo?.Value?.GetChild("common")?.GetChild("clienticon")?.ToString()}.ico";
selection.Publisher = appData.publishers[0] ?? appInfo?.Value?.GetChild("extended")?.GetChild("publisher")?.ToString(); selection.Publisher = appData?.publishers[0] ?? appInfo?.Value?.GetChild("extended")?.GetChild("publisher")?.ToString();
if (Program.Canceled) return; if (Program.Canceled) return;
Program.Invoke(selectionTreeView, delegate Program.Invoke(selectionTreeView, delegate
@ -224,7 +225,7 @@ internal partial class SelectForm : CustomForm
if (Program.Canceled) return; if (Program.Canceled) return;
TreeNode programNode = TreeNodes.Find(s => s.Name == appId) ?? new(); TreeNode programNode = TreeNodes.Find(s => s.Name == appId) ?? new();
programNode.Name = appId; programNode.Name = appId;
programNode.Text = appData.name ?? name; programNode.Text = appData?.name ?? name;
programNode.Checked = selection.Enabled; programNode.Checked = selection.Enabled;
programNode.Remove(); programNode.Remove();
selectionTreeView.Nodes.Add(programNode); selectionTreeView.Nodes.Add(programNode);