fix: stream api changes
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import { NostrEvent } from "@snort/system";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import { FormattedMessage } from "react-intl";
|
||||
import { SnortContext } from "@snort/system-react";
|
||||
@ -212,18 +211,7 @@ export default function NostrProviderDialog({
|
||||
provider.updateStreamInfo(system, ex);
|
||||
others.onFinish?.(ex);
|
||||
}}
|
||||
ev={
|
||||
{
|
||||
tags: [
|
||||
["title", info.streamInfo?.title ?? ""],
|
||||
["summary", info.streamInfo?.summary ?? ""],
|
||||
["image", info.streamInfo?.image ?? ""],
|
||||
...(info.streamInfo?.goal ? [["goal", info.streamInfo.goal]] : []),
|
||||
...(info.streamInfo?.content_warning ? [["content-warning", info.streamInfo?.content_warning]] : []),
|
||||
...(info.streamInfo?.tags?.map(a => ["t", a]) ?? []),
|
||||
],
|
||||
} as NostrEvent
|
||||
}
|
||||
ev={others.ev}
|
||||
options={{
|
||||
canSetStream: false,
|
||||
canSetStatus: false,
|
||||
|
@ -15,6 +15,7 @@ export default function DashboardIntroStep1() {
|
||||
const [error, setError] = useState<string>();
|
||||
|
||||
useEffect(() => {
|
||||
//TODO: remove "streamInfo" using account info
|
||||
DefaultProvider.info().then(i => {
|
||||
setTitle(i.streamInfo?.title ?? "");
|
||||
setDescription(i.streamInfo?.summary ?? "");
|
||||
|
@ -3,7 +3,6 @@ import {
|
||||
StreamProvider,
|
||||
StreamProviderEndpoint,
|
||||
StreamProviderInfo,
|
||||
StreamProviderStreamInfo,
|
||||
StreamProviders,
|
||||
} from ".";
|
||||
import { EventKind, EventPublisher, NostrEvent, SystemInterface } from "@snort/system";
|
||||
@ -38,7 +37,6 @@ export class NostrStreamProvider implements StreamProvider {
|
||||
name: this.name,
|
||||
state: StreamState.Planned,
|
||||
viewers: 0,
|
||||
streamInfo: rsp.event,
|
||||
balance: rsp.balance,
|
||||
tosAccepted: rsp.tos?.accepted,
|
||||
tosLink: rsp.tos?.link,
|
||||
@ -64,8 +62,9 @@ export class NostrStreamProvider implements StreamProvider {
|
||||
}
|
||||
|
||||
async updateStreamInfo(_: SystemInterface, ev: NostrEvent): Promise<void> {
|
||||
const { title, summary, image, tags, contentWarning, goal, gameId } = extractStreamInfo(ev);
|
||||
const { title, summary, image, tags, contentWarning, goal, gameId, id } = extractStreamInfo(ev);
|
||||
await this.#getJson("PATCH", "event", {
|
||||
id,
|
||||
title,
|
||||
summary,
|
||||
image,
|
||||
@ -76,6 +75,7 @@ export class NostrStreamProvider implements StreamProvider {
|
||||
}
|
||||
|
||||
async updateStream(props: {
|
||||
id: string,
|
||||
title?: string;
|
||||
summary?: string;
|
||||
image?: string;
|
||||
@ -184,7 +184,6 @@ export class NostrStreamProvider implements StreamProvider {
|
||||
|
||||
interface AccountResponse {
|
||||
balance: number;
|
||||
event?: StreamProviderStreamInfo;
|
||||
endpoints: Array<IngestEndpoint>;
|
||||
tos?: {
|
||||
accepted: boolean;
|
||||
|
Reference in New Issue
Block a user