Add ends timestamp

This commit is contained in:
Kieran 2023-06-25 22:49:49 +01:00
parent c4aaadd48a
commit ec2ef2142b
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -52,7 +52,8 @@ export function NewStream({
const now = unixNow();
const dTag = findTag(ev, "d") ?? now.toString();
const starts = findTag(ev, "starts") ?? now.toString();
return eb
const ends = findTag(ev, "ends") ?? now.toString();
eb
.kind(30_311)
.tag(["d", dTag])
.tag(["title", title])
@ -61,6 +62,10 @@ export function NewStream({
.tag(["streaming", stream])
.tag(["status", status])
.tag(["starts", starts]);
if (status === StreamState.Ended) {
eb.tag(["ends", ends]);
}
return eb;
});
console.debug(evNew);
System.BroadcastEvent(evNew);