update NIP-35: use "x" tag instead of "btih".

This commit is contained in:
fiatjaf 2024-08-25 08:52:52 -03:00
parent 855692c1b4
commit da35099d39
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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)]),
],