mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-20 21:12:38 +02:00
Merge pull request #207 from fiatjaf/torrents-x
update NIP-35: use "x" tag instead of "btih"
This commit is contained in:
@@ -22,7 +22,7 @@ export function getTorrentTitle(torrent: NostrEvent) {
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
export function getTorrentBtih(torrent: NostrEvent) {
|
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");
|
if (!btih) throw new Error("Missing btih");
|
||||||
return btih;
|
return btih;
|
||||||
}
|
}
|
||||||
|
@@ -107,7 +107,7 @@ export default function NewTorrentView() {
|
|||||||
content: values.description,
|
content: values.description,
|
||||||
tags: [
|
tags: [
|
||||||
["title", values.title],
|
["title", values.title],
|
||||||
["btih", values.btih],
|
["x", values.btih],
|
||||||
...values.tags.map((v) => ["t", v]),
|
...values.tags.map((v) => ["t", v]),
|
||||||
...values.files.map((f) => ["file", f.name, String(f.size)]),
|
...values.files.map((f) => ["file", f.name, String(f.size)]),
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user