Skip to content

Commit

Permalink
修复某些情况下少加载了部分已安装游戏的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Aug 27, 2021
1 parent dc0596e commit da27ede
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public IEnumerable<SteamApp> OwnsApps(IEnumerable<SteamApp> apps)
//IsInstalled = IsAppInstalled(s.AppId)
//s.IsInstalled = IsAppInstalled(s.AppId);
//s.InstalledDir = GetAppInstallDir(s.AppId);
s.State = IsAppInstalled(s.AppId) ? 4 : s.State;
s.InstalledDir = string.IsNullOrEmpty(s.InstalledDir) ? GetAppInstallDir(s.AppId) : s.InstalledDir;
s.Type = Enum.TryParse<SteamAppType>(GetAppData(s.AppId, "type"), true, out var result) ? result : SteamAppType.Unknown;
return s;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ private string[] GetLibraryPaths()

if (pathNode == null) break;

if (pathNode.Type == VTokenType.Object)
if (pathNode.path != null)
{
// New format
// Valve introduced a new format for the "libraryfolders.vdf" file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public async override void Initialize()
return;
}

#region 加载备注信息
_SteamUsersSourceList.AddOrUpdate(list);
var accountRemarks = Serializable.Clone<IReadOnlyDictionary<long, string?>?>(SteamAccountSettings.AccountRemarks.Value);

Expand All @@ -97,6 +98,13 @@ public async override void Initialize()
string? remark = null;
accountRemarks?.TryGetValue(user.SteamId64, out remark);
user.Remark = remark;
}
_SteamUsersSourceList.Refresh();
#endregion

#region 通过webapi加载头像图片用户信息
foreach (var user in _SteamUsersSourceList.Items)
{
var temp = await webApiService.GetUserInfo(user.SteamId64);
if (!string.IsNullOrEmpty(temp.SteamID))
{
Expand Down Expand Up @@ -124,7 +132,9 @@ public async override void Initialize()
}

_SteamUsersSourceList.Refresh();
#endregion

#region 加载动态头像头像框数据
foreach (var item in _SteamUsersSourceList.Items)
{
item.MiniProfile = await webApiService.GetUserMiniProfile(item.SteamId3_Int);
Expand All @@ -138,6 +148,7 @@ public async override void Initialize()
}

_SteamUsersSourceList.Refresh();
#endregion

//this.WhenAnyValue(x => x.SteamUsers)
// .Subscribe(items => items?
Expand Down

0 comments on commit da27ede

Please sign in to comment.