2 Commits
Author SHA1 Message Date
thePR0M3TH3ANandClaude Opus 4.8 e793b359c3 feat(nip71): mirror carries the video's hashtags (from t tags / nip71 metadata)
Closes the real hashtag gap. Verified the upload modal's existing NIP-71 hashtag
editor (Nip71FormManager → nip71.hashtags → buildNip71MetadataTags) ALREADY emits
`t` tags on the 30078, which bitvid's feed scoring already reads — so publish+feed
hashtags work today. The gap was the 34235 mirror reading only `video.hashtags`
(empty for form-authored videos).

buildNip71MirrorEvent now resolves hashtags from whichever source is present —
video.hashtags, video.nip71.hashtags, or the raw `t` tags on video.tags — deduped,
lowercased, with bitvid's internal "video" topic tag dropped. So a shared video
stays categorized on Nostube/Amethyst regardless of how its tags were authored.

(The earlier content.hashtags builder path from a1bf7b15 stays as a harmless
secondary input; the form/t-tag path is the one users actually exercise.)

tests/nip71-mirror.test.mjs: hashtags sourced from nip71.hashtags; from raw t tags
with the 'video' topic dropped + deduped. Mutation-verified.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-22 11:30:12 -04:00
thePR0M3TH3ANandClaude Opus 4.8 0e2f683b62 feat(nip71): Phase 0 — addressable 34235/36 mirror builder + magnet/i/ox imeta
First build step of the NIP-71 interop plan (no UX; FEATURE_PUBLISH_NIP71 stays
off). Pure mapping from a bitvid video (kind-30078 shape) to an opt-in addressable
NIP-71 mirror event.

- js/nostr/nip71.js (foundational):
  - normalizeNip71Kind now recognizes the addressable kinds 34235/34236 (so the
    parser preserves them), alongside 21/22.
  - imeta builder + parser gained standard NIP-94 fields magnet, i (infohash), ox
    — bitvid's WebTorrent now rides the standard, round-trippable.
- js/nostr/nip71Mirror.js (new): buildNip71MirrorEvent(video, options) →
  { ok:true, event } | { ok:false, reason }. Builds kind 34235 (normal) / 34236
  (short, by dims or explicit flag), d=videoRootId, title/published_at(stable)/alt,
  imeta (url/m/image/x/ox/magnet/i/dim/duration), content-warning (NSFW), t
  hashtags, origin + a back-pointer to the canonical 30078, client=bitvid.
  Hard rules enforced: private videos refused; non-HTTPS-url refused.

tests/nip71-mirror.test.mjs: spec-shape mapping, round-trip via
extractNip71MetadataFromTags (magnet/i/ox survive), private + url-less refusals,
portrait→34236 + content-warning, explicit short override, MIME derivation.
Mutation-verified (private refusal, magnet imeta, d-tag all load-bearing).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-21 23:05:12 -04:00