diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2022-04-27 22:25:47 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2022-04-27 22:25:47 -0500 |
| commit | 223543b5889a1e3ee139b597eaa2cdfc5988fe02 (patch) | |
| tree | 41feb6a183e0e830ee3cfd55ca2864e6547fbe38 /src | |
| parent | 483df13b252ba8e64e63640414b132ebbc1177a6 (diff) | |
| download | slskd-223543b5889a1e3ee139b597eaa2cdfc5988fe02.tar.gz | |
broadcast creates and deletes
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Search/API/Hubs/SearchHub.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/slskd/Search/API/Hubs/SearchHub.cs b/src/slskd/Search/API/Hubs/SearchHub.cs index 86434669..4417f8c9 100644 --- a/src/slskd/Search/API/Hubs/SearchHub.cs +++ b/src/slskd/Search/API/Hubs/SearchHub.cs @@ -26,8 +26,10 @@ namespace slskd.Search.API public static class SearchHubMethods { + public static readonly string Create = "CREATE"; public static readonly string Response = "RESPONSE"; public static readonly string Update = "UPDATE"; + public static readonly string Delete = "DELETE"; } /// <summary> @@ -57,6 +59,16 @@ namespace slskd.Search.API { return hub.Clients.All.SendAsync(SearchHubMethods.Response, new { searchId, response }); } + + public static Task BroadcastCreateAsync(this IHubContext<SearchHub> hub, Search search) + { + return hub.Clients.All.SendAsync(SearchHubMethods.Create, search); + } + + public static Task BroadcastDeleteAsync(this IHubContext<SearchHub> hub, Search search) + { + return hub.Clients.All.SendAsync(SearchHubMethods.Delete, search); + } } /// <summary> |
