filter streams with no HLS link
This commit is contained in:
@ -52,8 +52,6 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vite",
|
"start": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"deploy": "__XXX='false' && yarn build && npx wrangler pages publish --project-name nostr-live build",
|
|
||||||
"deploy:xxzap": "__XXX='true' && yarn build && npx wrangler pages publish --project-name xxzap build",
|
|
||||||
"intl-extract": "formatjs extract 'src/**/*.ts*' --ignore='**/*.d.ts' --out-file src/lang.json --flatten true",
|
"intl-extract": "formatjs extract 'src/**/*.ts*' --ignore='**/*.d.ts' --out-file src/lang.json --flatten true",
|
||||||
"intl-compile": "formatjs compile src/lang.json --out-file src/translations/en.json"
|
"intl-compile": "formatjs compile src/lang.json --out-file src/translations/en.json"
|
||||||
},
|
},
|
||||||
|
2
src/d.ts
2
src/d.ts
@ -2,8 +2,6 @@
|
|||||||
/// <reference types="@webbtc/webln-types" />
|
/// <reference types="@webbtc/webln-types" />
|
||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
declare const __XXX: boolean;
|
|
||||||
declare const __XXX_HOST: string;
|
|
||||||
declare const __ZAP_STREAM_VERSION__: string;
|
declare const __ZAP_STREAM_VERSION__: string;
|
||||||
|
|
||||||
declare module "*.md" {
|
declare module "*.md" {
|
||||||
|
@ -10,7 +10,7 @@ import { Icon } from "./icon";
|
|||||||
import { useStreamProvider } from "@/hooks/stream-provider";
|
import { useStreamProvider } from "@/hooks/stream-provider";
|
||||||
import { NostrStreamProvider, StreamProvider, StreamProviders } from "@/providers";
|
import { NostrStreamProvider, StreamProvider, StreamProviders } from "@/providers";
|
||||||
import { StreamEditor, StreamEditorProps } from "./stream-editor";
|
import { StreamEditor, StreamEditorProps } from "./stream-editor";
|
||||||
import { eventLink, findTag } from "@/utils";
|
import { eventLink } from "@/utils";
|
||||||
import { NostrProviderDialog } from "./nostr-provider-dialog";
|
import { NostrProviderDialog } from "./nostr-provider-dialog";
|
||||||
import AsyncButton from "./async-button";
|
import AsyncButton from "./async-button";
|
||||||
|
|
||||||
@ -38,14 +38,10 @@ function NewStream({ ev, onFinish }: Omit<StreamEditorProps, "onFinish"> & { onF
|
|||||||
onFinish={ex => {
|
onFinish={ex => {
|
||||||
currentProvider.updateStreamInfo(system, ex);
|
currentProvider.updateStreamInfo(system, ex);
|
||||||
if (!ev) {
|
if (!ev) {
|
||||||
if (findTag(ex, "content-warning") && __XXX_HOST && __XXX === false) {
|
navigate(`/${eventLink(ex)}`, {
|
||||||
location.href = `${__XXX_HOST}/${eventLink(ex)}`;
|
state: ex,
|
||||||
} else {
|
});
|
||||||
navigate(`/${eventLink(ex)}`, {
|
onFinish?.();
|
||||||
state: ex,
|
|
||||||
});
|
|
||||||
onFinish?.();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
onFinish?.();
|
onFinish?.();
|
||||||
}
|
}
|
||||||
|
@ -75,15 +75,17 @@ export function NostrProviderDialog({
|
|||||||
const raw = Math.max(0, info.balance / ep.rate);
|
const raw = Math.max(0, info.balance / ep.rate);
|
||||||
if (ep.unit === "min" && raw > 60) {
|
if (ep.unit === "min" && raw > 60) {
|
||||||
const pm = hrs * 60 * ep.rate;
|
const pm = hrs * 60 * ep.rate;
|
||||||
return <>
|
return (
|
||||||
{`${(raw / 60).toFixed(0)} hour @ ${ep.rate} sats/${ep.unit}`}
|
<>
|
||||||
or <br />
|
{`${(raw / 60).toFixed(0)} hour @ ${ep.rate} sats/${ep.unit}`}
|
||||||
{`${pm.toLocaleString()} sats/month ($${(rate.ask * pm * 1e-8).toFixed(2)}/mo) streaming ${hrs} hrs/month`}
|
or <br />
|
||||||
<div className="paper">
|
{`${pm.toLocaleString()} sats/month ($${(rate.ask * pm * 1e-8).toFixed(2)}/mo) streaming ${hrs} hrs/month`}
|
||||||
Hrs
|
<div className="paper">
|
||||||
<input type="number" value={hrs} onChange={e => setHrs(e.target.valueAsNumber)} />
|
Hrs
|
||||||
</div>
|
<input type="number" value={hrs} onChange={e => setHrs(e.target.valueAsNumber)} />
|
||||||
</>
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return `${raw.toFixed(0)} ${ep.unit} @ ${ep.rate} sats/${ep.unit}`;
|
return `${raw.toFixed(0)} ${ep.unit} @ ${ep.rate} sats/${ep.unit}`;
|
||||||
}
|
}
|
||||||
@ -273,7 +275,7 @@ export function NostrProviderDialog({
|
|||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<AddForwardInputs provider={provider} onAdd={() => { }} />
|
<AddForwardInputs provider={provider} onAdd={() => {}} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -56,24 +56,25 @@ export function useStreamsFeed(tag?: string) {
|
|||||||
const feed = useRequestBuilder(rb);
|
const feed = useRequestBuilder(rb);
|
||||||
const feedSorted = useMemo(() => {
|
const feedSorted = useMemo(() => {
|
||||||
if (feed) {
|
if (feed) {
|
||||||
if (__XXX) {
|
return [...feed].filter(
|
||||||
return [...feed].filter(
|
a => !import.meta.env.VITE_SINGLE_PUBLISHER || import.meta.env.VITE_SINGLE_PUBLISHER === getHost(a)
|
||||||
a =>
|
);
|
||||||
findTag(a, "content-warning") !== undefined &&
|
|
||||||
(!import.meta.env.VITE_SINGLE_PUBLISHER || import.meta.env.VITE_SINGLE_PUBLISHER === getHost(a))
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return [...feed].filter(
|
|
||||||
a =>
|
|
||||||
findTag(a, "content-warning") === undefined &&
|
|
||||||
(!import.meta.env.VITE_SINGLE_PUBLISHER || import.meta.env.VITE_SINGLE_PUBLISHER === getHost(a))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
}, [feed]);
|
}, [feed]);
|
||||||
|
|
||||||
const live = feedSorted.filter(a => findTag(a, "status") === StreamState.Live).sort(sortStarts);
|
const live = feedSorted
|
||||||
|
.filter(a => {
|
||||||
|
try {
|
||||||
|
return (
|
||||||
|
findTag(a, "status") === StreamState.Live &&
|
||||||
|
a.tags.some(a => a[0] === "streaming" && new URL(a[1]).pathname.includes(".m3u8"))
|
||||||
|
);
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.sort(sortStarts);
|
||||||
const planned = feedSorted.filter(a => findTag(a, "status") === StreamState.Planned).sort(sortStarts);
|
const planned = feedSorted.filter(a => findTag(a, "status") === StreamState.Planned).sort(sortStarts);
|
||||||
const ended = feedSorted
|
const ended = feedSorted
|
||||||
.filter(a => {
|
.filter(a => {
|
||||||
|
@ -162,7 +162,7 @@ export function StreamPage({ link, evPreload }: { evPreload?: NostrEvent; link:
|
|||||||
status={status}
|
status={status}
|
||||||
/>
|
/>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
<ProfileInfo ev={ev} goal={goal} />
|
<ProfileInfo ev={ev as TaggedNostrEvent} goal={goal} />
|
||||||
<StreamCards host={host} />
|
<StreamCards host={host} />
|
||||||
</div>
|
</div>
|
||||||
<LiveChat
|
<LiveChat
|
||||||
|
@ -41,7 +41,5 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
global: {},
|
global: {},
|
||||||
__XXX: process.env["__XXX"] || JSON.stringify(false),
|
|
||||||
__XXX_HOST: JSON.stringify("https://xxzap.com"),
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user