aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Search/API
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-04-27 22:25:47 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-04-27 22:25:47 -0500
commit223543b5889a1e3ee139b597eaa2cdfc5988fe02 (patch)
tree41feb6a183e0e830ee3cfd55ca2864e6547fbe38 /src/slskd/Search/API
parent483df13b252ba8e64e63640414b132ebbc1177a6 (diff)
downloadslskd-223543b5889a1e3ee139b597eaa2cdfc5988fe02.tar.gz
broadcast creates and deletes
Diffstat (limited to 'src/slskd/Search/API')
-rw-r--r--src/slskd/Search/API/Hubs/SearchHub.cs12
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>