feat: restore default stream details
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -69,12 +69,17 @@ public class StreamManagerFactory
|
||||
State = UserStreamState.Live,
|
||||
EdgeIp = info.EdgeIp,
|
||||
ForwardClientId = info.ClientId,
|
||||
Title = user.Title,
|
||||
Summary = user.Summary,
|
||||
Image = user.Image,
|
||||
ContentWarning = user.ContentWarning,
|
||||
Tags = user.Tags,
|
||||
Goal = user.Goal
|
||||
};
|
||||
|
||||
// add new stream
|
||||
if (existingLive == default)
|
||||
if (existingLive == null)
|
||||
{
|
||||
await stream.CopyLastStreamDetails(_db);
|
||||
var ev = _eventBuilder.CreateStreamEvent(stream);
|
||||
stream.Event = NostrJson.Serialize(ev) ?? "";
|
||||
_db.Streams.Add(stream);
|
||||
|
@ -261,7 +261,18 @@ public class UserService
|
||||
.ExecuteUpdateAsync(o => o.SetProperty(v => v.Title, req.Title)
|
||||
.SetProperty(v => v.Summary, req.Summary)
|
||||
.SetProperty(v => v.Image, req.Image)
|
||||
.SetProperty(v => v.Tags, req.Tags.Length > 0 ? string.Join(",", req.Tags) : null)
|
||||
.SetProperty(v => v.Tags, req.Tags != null && req.Tags.Length > 0 ? string.Join(",", req.Tags) : null)
|
||||
.SetProperty(v => v.ContentWarning, req.ContentWarning)
|
||||
.SetProperty(v => v.Goal, req.Goal));
|
||||
}
|
||||
|
||||
public async Task SetStreamInfoDefaults(string pubkey, PatchEvent req)
|
||||
{
|
||||
await _db.Users.Where(a => a.PubKey == pubkey)
|
||||
.ExecuteUpdateAsync(o => o.SetProperty(v => v.Title, req.Title)
|
||||
.SetProperty(v => v.Summary, req.Summary)
|
||||
.SetProperty(v => v.Image, req.Image)
|
||||
.SetProperty(v => v.Tags, req.Tags != null && req.Tags.Length > 0 ? string.Join(",", req.Tags) : null)
|
||||
.SetProperty(v => v.ContentWarning, req.ContentWarning)
|
||||
.SetProperty(v => v.Goal, req.Goal));
|
||||
}
|
||||
|
Reference in New Issue
Block a user