aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Application/Peer
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-09-12 11:07:19 -0500
committerJP Dillingham <jpdillingham@gmail.com>2021-09-12 11:07:19 -0500
commit32b6e44f6db7a77905e45e7bbbe94f91be02fdee (patch)
tree72af386ab592d9a00ed949103816aaa5aa15015a /src/slskd/Application/Peer
parent495ac50e153904b421aa5c459a1006d27dd59d54 (diff)
downloadslskd-32b6e44f6db7a77905e45e7bbbe94f91be02fdee.tar.gz
remove ISoulseekClient from PeerService
Diffstat (limited to 'src/slskd/Application/Peer')
-rw-r--r--src/slskd/Application/Peer/PeerService.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/slskd/Application/Peer/PeerService.cs b/src/slskd/Application/Peer/PeerService.cs
index e0e03fa6..96d65bd5 100644
--- a/src/slskd/Application/Peer/PeerService.cs
+++ b/src/slskd/Application/Peer/PeerService.cs
@@ -22,7 +22,6 @@ namespace slskd.Peer
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
- using ISoulseekClient = Soulseek.ISoulseekClient;
/// <summary>
/// Provides information and operations for network peers.
@@ -34,20 +33,20 @@ namespace slskd.Peer
/// <summary>
/// Initializes a new instance of the <see cref="PeerService"/> class.
/// </summary>
- /// <param name="client">The client instance to use.</param>
+ /// <param name="application"></param>
/// <param name="contextFactory">The database context to use.</param>
/// <param name="log">The logger.</param>
public PeerService(
- ISoulseekClient client,
+ IApplication application,
IDbContextFactory<PeerDbContext> contextFactory,
ILogger<PeerService> log)
{
- Client = client;
+ Application = application;
ContextFactory = contextFactory;
Log = log;
}
- private ISoulseekClient Client { get; }
+ private IApplication Application { get; }
private IDbContextFactory<PeerDbContext> ContextFactory { get; }
private ILogger<PeerService> Log { get; set; }
@@ -69,7 +68,7 @@ namespace slskd.Peer
return info;
}
- var soulseekUserInfo = await Client.GetUserInfoAsync(username);
+ var soulseekUserInfo = await Application.GetUserInfoAsync(username);
info = Info.FromSoulseekUserInfo(username, soulseekUserInfo);
if (peerExists)
@@ -93,7 +92,7 @@ namespace slskd.Peer
/// <returns>The retrieved endpoint.</returns>
public Task<IPEndPoint> GetIPEndPointAsync(string username)
{
- return Client.GetUserEndPointAsync(username);
+ return Application.GetUserEndPointAsync(username);
}
/// <summary>
@@ -103,7 +102,7 @@ namespace slskd.Peer
/// <returns>The retrieved status.</returns>
public async Task<Status> GetStatusAsync(string username)
{
- var soulseekStatus = await Client.GetUserStatusAsync(username);
+ var soulseekStatus = await Application.GetUserStatusAsync(username);
return Status.FromSoulseekUserStatus(soulseekStatus);
}
@@ -115,7 +114,7 @@ namespace slskd.Peer
/// <param name="days">The number of days to grant.</param>
/// <returns>The operation context.</returns>
public Task GrantPrivilegesAsync(string username, int days)
- => Client.GrantUserPrivilegesAsync(username, days);
+ => Application.GrantUserPrivilegesAsync(username, days);
/// <summary>
/// Retrieves a value indicating whether the specified peer is privileged.
@@ -123,7 +122,7 @@ namespace slskd.Peer
/// <param name="username">The username of the peer.</param>
/// <returns>A value indicating whether the specified peer is privileged.</returns>
public Task<bool> IsPrivilegedAsync(string username)
- => Client.GetUserPrivilegedAsync(username);
+ => Application.GetUserPrivilegedAsync(username);
/// <summary>
/// Adds the specified username to the server-side user list.
@@ -132,7 +131,7 @@ namespace slskd.Peer
/// <returns>The operation context.</returns>
public async Task WatchAsync(string username)
{
- await Client.AddUserAsync(username);
+ await Application.AddUserAsync(username);
}
}
} \ No newline at end of file