Create variants

This commit is contained in:
2023-07-11 16:08:57 +01:00
parent 58adc8b9ae
commit 1fba6c3c37
7 changed files with 206 additions and 30 deletions

View File

@ -20,7 +20,7 @@ public class SrsApi
public async Task<List<Client>> ListClients()
{
var rsp = await _client.GetFromJsonAsync<ListClientsResponse>("/api/v1/clients");
var rsp = await _client.GetFromJsonAsync<ListClientsResponse>("/api/v1/clients/?count=10000");
return rsp!.Clients;
}
@ -105,13 +105,13 @@ public class Stream
public long? RecvBytes { get; set; }
[JsonProperty("kbps")]
public Kbps Kbps { get; set; }
public Kbps? Kbps { get; set; }
[JsonProperty("publish")]
public Publish Publish { get; set; }
[JsonProperty("video")]
public Video Video { get; set; }
public Video? Video { get; set; }
[JsonProperty("audio")]
public Audio Audio { get; set; }

View File

@ -56,8 +56,9 @@ public class StreamManager
await PublishEvent(user, ev);
}
public async Task ConsumeQuota(string streamKey, double duration, string clientId)
public async Task ConsumeQuota(string streamKey, double duration, string clientId, string app)
{
if (!app.EndsWith("/source")) return;
var user = await GetUserFromStreamKey(streamKey);
if (user == default) throw new Exception("No stream key found");