Skip to content

Commit

Permalink
only show streams that have video streams
Browse files Browse the repository at this point in the history
  • Loading branch information
hzrd149 committed Dec 13, 2024
1 parent 27fe231 commit ed1eeb7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/views/streams/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useMemo } from "react";
import { Flex, Heading, SimpleGrid, Switch } from "@chakra-ui/react";
import { getEventUID } from "applesauce-core/helpers";
import { getEventUID, isStreamURL } from "applesauce-core/helpers";
import { Filter, kinds } from "nostr-tools";

import useTimelineLoader from "../../hooks/use-timeline-loader";
Expand All @@ -19,7 +19,7 @@ import { useRouteStateBoolean } from "../../hooks/use-route-state-value";
import { useReadRelays } from "../../hooks/use-client-relays";
import { AdditionalRelayProvider, useAdditionalRelayContext } from "../../providers/local/additional-relay-context";
import useFavoriteStreams from "../../hooks/use-favorite-streams";
import { getStreamStatus } from "../../helpers/nostr/stream";
import { getStreamStatus, getStreamStreamingURLs } from "../../helpers/nostr/stream";

function StreamsPage() {
useAppTitle("Streams");
Expand All @@ -30,6 +30,11 @@ function StreamsPage() {
const eventFilter = useCallback(
(event: NostrEvent) => {
if (userMuteFilter(event)) return false;

// only show streams that have video streams
const urls = getStreamStreamingURLs(event);
if (!urls.some(isStreamURL)) return false;

return true;
},
[userMuteFilter],
Expand Down

0 comments on commit ed1eeb7

Please sign in to comment.