aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-08-12 09:48:05 -0500
committerJP Dillingham <jp@dillingham.me>2022-08-12 09:48:05 -0500
commit7c9863e606d7684d543c730cc2c2c0d5aae4d748 (patch)
tree222ba13f158a709d825c86ffaacdf4d5db8e8e41 /src
parente3b89745f0d1d18608d7183cb2af9e45c54d139e (diff)
downloadslskd-7c9863e606d7684d543c730cc2c2c0d5aae4d748.tar.gz
add GetGroupInfo
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Transfers/Uploads/UploadQueue.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/slskd/Transfers/Uploads/UploadQueue.cs b/src/slskd/Transfers/Uploads/UploadQueue.cs
index 9ac6b385..36e5474c 100644
--- a/src/slskd/Transfers/Uploads/UploadQueue.cs
+++ b/src/slskd/Transfers/Uploads/UploadQueue.cs
@@ -57,6 +57,13 @@ namespace slskd.Transfers
void Enqueue(string username, string filename);
/// <summary>
+ /// Gets information about the specified <paramref name="groupName"/>.
+ /// </summary>
+ /// <param name="groupName">The name of the group.</param>
+ /// <returns>The group information.</returns>
+ UploadGroup GetGroupInfo(string groupName);
+
+ /// <summary>
/// Computes the estimated queue position of the specified <paramref name="filename"/> for the specified <paramref name="username"/>.
/// </summary>
/// <param name="username">The username associated with the file.</param>
@@ -224,6 +231,21 @@ namespace slskd.Transfers
}
/// <summary>
+ /// Gets information about the specified <paramref name="groupName"/>.
+ /// </summary>
+ /// <param name="groupName">The name of the group.</param>
+ /// <returns>The group information.</returns>
+ public UploadGroup GetGroupInfo(string groupName)
+ {
+ if (Groups.TryGetValue(groupName, out var group))
+ {
+ return group;
+ }
+
+ throw new NotFoundException($"A group with the name {groupName} could not be found");
+ }
+
+ /// <summary>
/// Computes the estimated queue position of the specified <paramref name="filename"/> for the specified <paramref name="username"/>.
/// </summary>
/// <param name="username">The username associated with the file.</param>