From c3108fcdb83d1c4ad032971dcb2be1d9bdc04983 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 29 May 2021 10:21:44 -0500 Subject: tidy up --- src/slskd/Core/Search/Domain/Search.cs | 35 +++++++++++----------------------- 1 file changed, 11 insertions(+), 24 deletions(-) (limited to 'src') 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 Responses { get; set; } = new List(); [JsonIgnore] public string ResponsesJson @@ -49,22 +49,9 @@ namespace slskd.Search } } - [NotMapped] - public IEnumerable Responses { get; set; } = new List(); - - public Search UpdateFromSoulseekSearch(Soulseek.Search search) - { - FileCount = search.FileCount; - LockedFileCount = search.LockedFileCount; - ResponseCount = search.ResponseCount; - State = search.State; - return this; - } - - public Search AddResponses(List 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 -- cgit v1.2.3