diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-05-29 10:21:44 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-05-29 10:21:44 -0500 |
| commit | c3108fcdb83d1c4ad032971dcb2be1d9bdc04983 (patch) | |
| tree | 8a57a7f37024573f949c14668640e902d0c1949f | |
| parent | 6532946913e03086cb7a9f308770b52265b98b98 (diff) | |
| download | slskd-c3108fcdb83d1c4ad032971dcb2be1d9bdc04983.tar.gz | |
tidy up
| -rw-r--r-- | src/slskd/Core/Search/Domain/Search.cs | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/src/slskd/Core/Search/Domain/Search.cs b/src/slskd/Core/Search/Domain/Search.cs index b5ed8e4a..e89caf54 100644 --- a/src/slskd/Core/Search/Domain/Search.cs +++ b/src/slskd/Core/Search/Domain/Search.cs @@ -27,17 +27,17 @@ namespace slskd.Search public class Search { + public DateTime? EndedAt { get; set; } + public int FileCount { get; set; } + [Key] public Guid Id { get; init; } - public DateTime StartedAt { get; init; } = DateTime.UtcNow; - public DateTime? EndedAt { get; set; } - public int FileCount { get; set; } public int LockedFileCount { get; set; } public int ResponseCount { get; set; } - public string SearchText { get; init; } - public SearchStates State { get; set; } - public int Token { get; init; } + + [NotMapped] + public IEnumerable<Response> Responses { get; set; } = new List<Response>(); [JsonIgnore] public string ResponsesJson @@ -49,22 +49,9 @@ namespace slskd.Search } } - [NotMapped] - public IEnumerable<Response> Responses { get; set; } = new List<Response>(); - - public Search UpdateFromSoulseekSearch(Soulseek.Search search) - { - FileCount = search.FileCount; - LockedFileCount = search.LockedFileCount; - ResponseCount = search.ResponseCount; - State = search.State; - return this; - } - - public Search AddResponses(List<Response> responses) - { - Responses = responses; - return this; - } + public string SearchText { get; init; } + public DateTime StartedAt { get; init; } = DateTime.UtcNow; + public SearchStates State { get; set; } + public int Token { get; init; } } -} +}
\ No newline at end of file |
