aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-04-06 17:25:46 -0500
committerJP Dillingham <jp@dillingham.me>2025-04-06 17:25:46 -0500
commit831e9ce49abbcc64a7b75c6fb2c90ad20b233e00 (patch)
tree82a17f1bd101bb772f6e1a4c45b45007b67a8659
parentc173139efbbb096aa23c1bf78ee0159f101f6a75 (diff)
downloadslskd-831e9ce49abbcc64a7b75c6fb2c90ad20b233e00.tar.gz
formatting/docs
-rw-r--r--src/slskd/Application.cs3
-rw-r--r--tests/slskd.Tests.Unit/Users/UserServiceTests.cs16
2 files changed, 10 insertions, 9 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index acfecdbf..1e71652c 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -1662,7 +1662,7 @@ 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.ProfilePicture);
+ var profilePicture = Users.GetProfilePicture(Options.Soulseek.Picture);
if (Users.IsBlacklisted(username, endpoint.Address))
{
@@ -1691,6 +1691,7 @@ namespace slskd
// 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.
+ // revisited 3 years later: why was it important to leave this comment??
var info = new UserInfo(
description: Options.Soulseek.Description,
uploadSlots: group.Slots,
diff --git a/tests/slskd.Tests.Unit/Users/UserServiceTests.cs b/tests/slskd.Tests.Unit/Users/UserServiceTests.cs
index 28f54629..205ff0e2 100644
--- a/tests/slskd.Tests.Unit/Users/UserServiceTests.cs
+++ b/tests/slskd.Tests.Unit/Users/UserServiceTests.cs
@@ -130,9 +130,9 @@
public void Returns_Null_When_Path_Is_NullOrWhitespace(string path)
{
var (service, _) = GetFixture();
-
+
var result = service.GetProfilePicture(path);
-
+
Assert.Null(result);
}
@@ -141,9 +141,9 @@
{
const string nonExistentPath = "nonexistent-file.jpg";
var (service, _) = GetFixture();
-
+
var result = service.GetProfilePicture(nonExistentPath);
-
+
Assert.Null(result);
}
@@ -155,11 +155,11 @@
{
// Write some test data to the temp file
System.IO.File.WriteAllBytes(tempFile, new byte[] { 1, 2, 3, 4, 5 });
-
+
var (service, _) = GetFixture();
-
+
var result = service.GetProfilePicture(tempFile);
-
+
Assert.NotNull(result);
Assert.Equal(new byte[] { 1, 2, 3, 4, 5 }, result);
}
@@ -174,7 +174,7 @@
}
}
- private static (UserService governor, Mocks mocks) GetFixture(Options options = null)
+ private static (UserService service, Mocks mocks) GetFixture(Options options = null)
{
var mocks = new Mocks(options);
var service = new UserService(