Skip to content

Commit

Permalink
🐛 Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Aug 26, 2023
1 parent 6c60203 commit dd67169
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -692,9 +692,10 @@ public uint[] GetInstalledAppIds()
return filePath;
}

public async Task<ImageSource.ClipStream?> GetAppImageAsync(SteamApp app, SteamApp.LibCacheType type)
public async Task<ImageSource.ClipStream?> 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);
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/BD.SteamClient/Services/ISteamService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public partial interface ISteamService
/// </summary>
Task<bool> SaveAppInfosToSteam();

Task<ImageSource.ClipStream?> GetAppImageAsync(SteamApp app, SteamApp.LibCacheType type);
Task<ImageSource.ClipStream?> GetAppImageAsync(SteamApp app, SteamApp.LibCacheType type, CancellationToken token = default);

ValueTask LoadAppImageAsync(SteamApp app);

Expand Down

0 comments on commit dd67169

Please sign in to comment.