aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-08-12 09:48:26 -0500
committerJP Dillingham <jp@dillingham.me>2022-08-12 09:48:26 -0500
commit1604fc912aece27e9be4e60ea421d1d80023f7c5 (patch)
tree7031552e0185a1d6189cc772b3bed593b9ac91de /src/slskd
parent7c9863e606d7684d543c730cc2c2c0d5aae4d748 (diff)
downloadslskd-1604fc912aece27e9be4e60ea421d1d80023f7c5.tar.gz
return actual data in UserInfoResolver
Diffstat (limited to 'src/slskd')
-rw-r--r--src/slskd/Application.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index cf37d933..c5c66cf1 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -973,10 +973,19 @@ namespace slskd
{
try
{
+ var groupName = Users.GetGroup(username);
+ var group = Transfers.Uploads.Queue.GetGroupInfo(groupName);
+
+ var forecastedPosition = Transfers.Uploads.Queue.ForecastPosition(username);
+
+ // if i get a user's info to determine whether i want to download files from them,
+ // i want to know how many slots they have, which gives me an idea of how fast their
+ // queue moves, and the length of the queue *ahead of me*, meaning how long i'd have to
+ // wait until my first download starts.
var info = new UserInfo(
description: Options.Soulseek.Description,
- uploadSlots: 1,
- queueLength: 0,
+ uploadSlots: group.Slots,
+ queueLength: forecastedPosition,
hasFreeUploadSlot: false);
return Task.FromResult(info);