From 41d27b2bb2fa9772504a31dad32454ecfb48850f Mon Sep 17 00:00:00 2001 From: kieran Date: Wed, 28 Aug 2024 11:10:55 +0100 Subject: [PATCH] Fix null cols --- NostrStreamer/Controllers/NostrController.cs | 8 +++++--- NostrStreamer/Database/UserStream.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NostrStreamer/Controllers/NostrController.cs b/NostrStreamer/Controllers/NostrController.cs index 9104fe3..1ced8a8 100644 --- a/NostrStreamer/Controllers/NostrController.cs +++ b/NostrStreamer/Controllers/NostrController.cs @@ -261,7 +261,7 @@ public class NostrController : Controller var existing = await _db.PushSubscriptions.FirstOrDefaultAsync(a => a.Key == sub.Key); if (existing != default) { - return Json(new {id = existing.Id}); + return Json(new { id = existing.Id }); } var newId = Guid.NewGuid(); @@ -292,7 +292,7 @@ public class NostrController : Controller var sub = await _db.PushSubscriptionTargets .Join(_db.PushSubscriptions, a => a.SubscriberPubkey, b => b.Pubkey, - (a, b) => new {a.SubscriberPubkey, a.TargetPubkey, b.Auth}) + (a, b) => new { a.SubscriberPubkey, a.TargetPubkey, b.Auth }) .Where(a => a.SubscriberPubkey == userPubkey && a.Auth == auth) .Select(a => a.TargetPubkey) .ToListAsync(); @@ -453,6 +453,8 @@ public class NostrController : Controller { PubKey = userPubkey, State = UserStreamState.Planned, + EdgeIp = string.Empty, + ForwardClientId = string.Empty }; newStream.PatchStream(req.Event); var ev = _eventBuilder.CreateStreamEvent(newStream); @@ -494,4 +496,4 @@ public class NostrController : Controller var claim = HttpContext.User.Claims.FirstOrDefault(a => a.Type == ClaimTypes.Name); return claim!.Value; } -} +} \ No newline at end of file diff --git a/NostrStreamer/Database/UserStream.cs b/NostrStreamer/Database/UserStream.cs index 05d14d7..4e9b766 100644 --- a/NostrStreamer/Database/UserStream.cs +++ b/NostrStreamer/Database/UserStream.cs @@ -54,7 +54,7 @@ public class UserStream public string? Thumbnail { get; set; } public Guid? EndpointId { get; set; } - public IngestEndpoint? Endpoint { get; init; } = null!; + public IngestEndpoint? Endpoint { get; init; } /// /// Publisher edge IP