Refactor audio event fetching logic to use event content; comment out unused filters

This commit is contained in:
2025-05-28 23:13:41 +02:00
parent 449c8cf808
commit 4496937461

View File

@@ -15,9 +15,11 @@ export default function Home() {
const { events } = useNostrEvents({ const { events } = useNostrEvents({
filter: { filter: {
// since: dateToUnix(now.current), // all new events from now // since: dateToUnix(now.current), // all new events from now
kinds: [1063], // NIP-94 audio events // kinds: [1063], // NIP-94 audio events
kinds: [1222], // NIP-94 audio events and text notes
// "#m": ["audio/mpeg", "audio/ogg", "audio/wav", "audio/webm"], // Audio MIME types // "#m": ["audio/mpeg", "audio/ogg", "audio/wav", "audio/webm"], // Audio MIME types
"#m": ["audio/mpeg", "audio/ogg", "audio/wav"], // Audio MIME types // "#m": ["audio/mpeg", "audio/ogg", "audio/wav"], // Audio MIME types
limit: 10
}, },
}) })
@@ -36,7 +38,8 @@ export default function Home() {
<VoidCanvas> <VoidCanvas>
{events.map((event) => { {events.map((event) => {
// Extract audio URL from NIP-94 event // Extract audio URL from NIP-94 event
const url = event.tags.find((tag) => tag[0] === "url")?.[1] // const url = event.tags.find((tag) => tag[0] === "url")?.[1]
const url = event.content
if (!url) return null if (!url) return null
return ( return (