diff --git a/package-lock.json b/package-lock.json index 6f7f841e..6a4f0abc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "imwald", - "version": "23.7.0", + "version": "23.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "imwald", - "version": "23.7.0", + "version": "23.7.1", "license": "MIT", "dependencies": { "@asciidoctor/core": "^3.0.4", @@ -9567,9 +9567,9 @@ "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", - "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", + "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index f93be2df..a683d2de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "imwald", - "version": "23.7.0", + "version": "23.7.1", "description": "Imwald — a user-friendly Nostr client focused on relay feed browsing, publications, and relay discovery", "private": true, "type": "module", diff --git a/src/components/MediaGridItem/index.tsx b/src/components/MediaGridItem/index.tsx index 0e0b060f..81dbbd81 100644 --- a/src/components/MediaGridItem/index.tsx +++ b/src/components/MediaGridItem/index.tsx @@ -1,10 +1,10 @@ -import { isNip71StyleVideoKind } from '@/constants' +import { ExtendedKind, isNip71StyleVideoKind } from '@/constants' import { getCachedThreadContextEvents } from '@/lib/navigation-related-events' import { toNote } from '@/lib/link' import client from '@/services/client.service' import { extractAllMediaFromEvent } from '@/services/media-extraction.service' import { useSmartNoteNavigationOptional } from '@/PageManager' -import { Images, Music, Play } from 'lucide-react' +import { Image as ImageIcon, Images, Music, Play } from 'lucide-react' import { type Event } from 'nostr-tools' import { useMemo } from 'react' @@ -14,8 +14,12 @@ export default function MediaGridItem({ event }: { event: Event }) { const media = useMemo(() => extractAllMediaFromEvent(event), [event]) const first = media.all[0] - const isVideo = first?.m?.startsWith('video/') || isNip71StyleVideoKind(event.kind) - const isAudio = first?.m?.startsWith('audio/') || event.kind === 1222 + /** Kind 20 is always treated as image unless imeta explicitly says video (rare mis-tag). */ + const isPictureKind = event.kind === ExtendedKind.PICTURE + const isVideo = + (!isPictureKind && first?.m?.startsWith('video/')) || + (!isPictureKind && isNip71StyleVideoKind(event.kind)) + const isAudio = first?.m?.startsWith('audio/') || event.kind === ExtendedKind.VOICE const hasMultiple = media.all.length > 1 // For videos prefer the poster image; fall back to video URL (browser extracts frame) @@ -51,7 +55,13 @@ export default function MediaGridItem({ event }: { event: Event }) { ) ) : (