namespace NostrStreamer.Database; public class UserStream { public Guid Id { get; init; } = Guid.NewGuid(); public string PubKey { get; init; } = null!; public User User { get; init; } = null!; public DateTime Starts { get; init; } = DateTime.UtcNow; public DateTime? Ends { get; set; } public UserStreamState State { get; set; } /// /// Stream title /// public string? Title { get; set; } /// /// Stream summary /// public string? Summary { get; set; } /// /// Stream cover image /// public string? Image { get; set; } /// /// Comma seperated tags /// public string? Tags { get; set; } /// /// Any content warning tag (NIP-36) /// public string? ContentWarning { get; set; } /// /// Stream goal /// public string? Goal { get; set; } /// /// Nostr Event for this stream /// public string Event { get; set; } = null!; /// /// URL of auto-generated thumbnail /// public string? Thumbnail { get; set; } public Guid EndpointId { get; set; } public IngestEndpoint Endpoint { get; init; } = null!; /// /// Publisher edge IP /// public string EdgeIp { get; set; } = null!; /// /// Publisher edge client id /// public string ForwardClientId { get; set; } = null!; public DateTime LastSegment { get; set; } = DateTime.UtcNow; /// /// Total sats charged during this stream /// public decimal MilliSatsCollected { get; set; } /// /// Total seconds produced in HLS segments /// public decimal Length { get; set; } /// /// Cost to view stream, tickets in /// public decimal? AdmissionCost { get; set; } public List Guests { get; init; } = new(); public List Recordings { get; init; } = new(); public UserStreamKey? StreamKey { get; init; } public string Key => StreamKey?.Key ?? User.StreamKey; } public enum UserStreamState { Unknown = 0, Planned = 1, Live = 2, Ended = 3 }