diff options
| author | JP Dillingham <jp@dillingham.me> | 2025-04-07 12:33:22 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2025-04-07 12:33:22 -0500 |
| commit | 21da11dfae33529d2672da06a8fa52b5343b5239 (patch) | |
| tree | 3de39aea286ccb9cc350307817b30e3981f3bbf6 /src/slskd/Application.cs | |
| parent | 831e9ce49abbcc64a7b75c6fb2c90ad20b233e00 (diff) | |
| download | slskd-21da11dfae33529d2672da06a8fa52b5343b5239.tar.gz | |
simplify fetch of picture bytes
Diffstat (limited to 'src/slskd/Application.cs')
| -rw-r--r-- | src/slskd/Application.cs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 1e71652c..4ed9d092 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -1662,7 +1662,16 @@ namespace slskd /// <returns>A Task resolving the UserInfo instance.</returns> private async Task<UserInfo> UserInfoResolver(string username, IPEndPoint endpoint) { - var profilePicture = Users.GetProfilePicture(Options.Soulseek.Picture); + byte[] pictureBytes = null; + + try + { + pictureBytes = await System.IO.File.ReadAllBytesAsync(Options.Soulseek.Picture); + } + catch (Exception ex) + { + Log.Warning("Failed to read Soulseek picture {Picture}: {Message}", Options.Soulseek.Picture, ex.Message); + } if (Users.IsBlacklisted(username, endpoint.Address)) { @@ -1671,7 +1680,7 @@ namespace slskd uploadSlots: 0, queueLength: int.MaxValue, hasFreeUploadSlot: false, - picture: profilePicture); + picture: pictureBytes); } try @@ -1697,7 +1706,7 @@ namespace slskd uploadSlots: group.Slots, queueLength: forecastedPosition, hasFreeUploadSlot: forecastedPosition == 0, - picture: profilePicture); + picture: pictureBytes); return info; } |
