From da35099d390727e4fcb639bad9745a9144ae4da9 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 25 Aug 2024 08:52:52 -0300 Subject: [PATCH] update NIP-35: use "x" tag instead of "btih". --- src/helpers/nostr/torrents.ts | 2 +- src/views/torrents/new.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/nostr/torrents.ts b/src/helpers/nostr/torrents.ts index 2c1c22bb5..a02fe7d06 100644 --- a/src/helpers/nostr/torrents.ts +++ b/src/helpers/nostr/torrents.ts @@ -22,7 +22,7 @@ export function getTorrentTitle(torrent: NostrEvent) { return title; } export function getTorrentBtih(torrent: NostrEvent) { - const btih = torrent.tags.find((a) => a[0] === "btih")?.[1]; + const btih = torrent.tags.find((a) => a[0] === "btih" || a[0] === "x")?.[1]; if (!btih) throw new Error("Missing btih"); return btih; } diff --git a/src/views/torrents/new.tsx b/src/views/torrents/new.tsx index fb61c6983..aee6cddd6 100644 --- a/src/views/torrents/new.tsx +++ b/src/views/torrents/new.tsx @@ -107,7 +107,7 @@ export default function NewTorrentView() { content: values.description, tags: [ ["title", values.title], - ["btih", values.btih], + ["x", values.btih], ...values.tags.map((v) => ["t", v]), ...values.files.map((f) => ["file", f.name, String(f.size)]), ],