aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Users/Domain
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-03-23 10:14:33 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-03-23 10:14:33 -0500
commit2b64f48bc6acb79bd2844333afea7e7a70d77a22 (patch)
tree89033f1105ec7ed262ed3ef8d17e0af468d8b86d /src/slskd/Users/Domain
parent78b7cb219b155e9be951b9c6b7ca9eb91ba794b2 (diff)
downloadslskd-2b64f48bc6acb79bd2844333afea7e7a70d77a22.tar.gz
move Info factory to extensions
Diffstat (limited to 'src/slskd/Users/Domain')
-rw-r--r--src/slskd/Users/Domain/Info.cs24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/slskd/Users/Domain/Info.cs b/src/slskd/Users/Domain/Info.cs
index aaf19942..e3969f17 100644
--- a/src/slskd/Users/Domain/Info.cs
+++ b/src/slskd/Users/Domain/Info.cs
@@ -17,35 +17,13 @@
namespace slskd.Users
{
- using System;
- using System.ComponentModel.DataAnnotations;
- using Soulseek;
-
- public class Info
+ public record Info
{
- [Key]
- public string Username { get; init; }
public string Description { get; init; }
public bool HasFreeUploadSlot { get; init; }
public bool HasPicture { get; init; }
public byte[] Picture { get; init; }
public int QueueLength { get; init; }
public int UploadSlots { get; init; }
- public DateTime UpdatedAt { get; init; }
-
- public static Info FromSoulseekUserInfo(string username, UserInfo info)
- {
- return new Info()
- {
- Username = username,
- Description = info.Description,
- HasFreeUploadSlot = info.HasFreeUploadSlot,
- HasPicture = info.HasPicture,
- Picture = info.Picture,
- QueueLength = info.QueueLength,
- UploadSlots = info.UploadSlots,
- UpdatedAt = DateTime.UtcNow,
- };
- }
}
}