aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-08-14 07:35:38 -0500
committerGitHub <noreply@github.com>2022-08-14 07:35:38 -0500
commitc18b2634edfa6c3bd659b8e9359f0d1f8e026f94 (patch)
treec75a62f9a56f2cba16f35b999c22b686f33e1c12 /src
parentb491037223b0772a533a29b55970e652bb04bfee (diff)
parent857d6c563e34115eead8314e094d6d61b1f344ae (diff)
downloadslskd-c18b2634edfa6c3bd659b8e9359f0d1f8e026f94.tar.gz
Merge branch 'master' into upload-bugs
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Application.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index 76934b43..29b6f656 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -980,6 +980,9 @@ namespace slskd
var groupName = Users.GetGroup(username);
var group = Transfers.Uploads.Queue.GetGroupInfo(groupName);
+ // forecast the position at which this user would enter the queue if they were to request
+ // a file at this moment. this will be zero if a slot is available and the transfer would
+ // begin immediately
var forecastedPosition = Transfers.Uploads.Queue.ForecastPosition(username);
// if i get a user's info to determine whether i want to download files from them,
@@ -990,7 +993,7 @@ namespace slskd
description: Options.Soulseek.Description,
uploadSlots: group.Slots,
queueLength: forecastedPosition,
- hasFreeUploadSlot: false);
+ hasFreeUploadSlot: forecastedPosition == 0);
return Task.FromResult(info);
}