diff --git a/src/BD.SteamClient/Services.Implementation/SteamServiceImpl.cs b/src/BD.SteamClient/Services.Implementation/SteamServiceImpl.cs index a320c837..7b3d0a2b 100644 --- a/src/BD.SteamClient/Services.Implementation/SteamServiceImpl.cs +++ b/src/BD.SteamClient/Services.Implementation/SteamServiceImpl.cs @@ -692,9 +692,10 @@ public uint[] GetInstalledAppIds() return filePath; } - public async Task GetAppImageAsync(SteamApp app, SteamApp.LibCacheType type) + public async Task GetAppImageAsync(SteamApp app, SteamApp.LibCacheType type, CancellationToken token = default) { - var mostRecentUser = Conn.SteamUsers.Items.Where(s => s.MostRecent).FirstOrDefault(); + //var mostRecentUser = Conn.SteamUsers.Items.Where(s => s.MostRecent).FirstOrDefault(); + var mostRecentUser = Conn.CurrentSteamUser; if (mostRecentUser != null) { var customFilePath = GetAppCustomImageFilePath(app.AppId, mostRecentUser, type); @@ -717,9 +718,9 @@ public uint[] GetInstalledAppIds() _ => null, }; - if (url == default) + if (string.IsNullOrEmpty(url)) return default; - var value = await ImageSource.GetAsync(url); + var value = await ImageSource.GetAsync(url, cache: true, cancellationToken: token); return value; } diff --git a/src/BD.SteamClient/Services/ISteamService.cs b/src/BD.SteamClient/Services/ISteamService.cs index 5748d2c6..71f6362a 100644 --- a/src/BD.SteamClient/Services/ISteamService.cs +++ b/src/BD.SteamClient/Services/ISteamService.cs @@ -118,7 +118,7 @@ public partial interface ISteamService /// Task SaveAppInfosToSteam(); - Task GetAppImageAsync(SteamApp app, SteamApp.LibCacheType type); + Task GetAppImageAsync(SteamApp app, SteamApp.LibCacheType type, CancellationToken token = default); ValueTask LoadAppImageAsync(SteamApp app);