mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Add NIP-71 video builder and dual publish workflow
This commit is contained in:
1 parent
fd400f6fb2
commit
62fe113bf4
6 files changed
+695
-128
No files matched your search
@@ -357,8 +357,7 @@ export class NostrService {
|
||||
}
|
||||
|
||||
async publishVideoNote(publishPayload, pubkey) {
|
||||
const result = await this.nostrClient.publishVideo(publishPayload, pubkey);
|
||||
const detail = { pubkey, result };
|
||||
const detail = { pubkey };
|
||||
if (publishPayload && typeof publishPayload === "object") {
|
||||
detail.payload = publishPayload;
|
||||
if (publishPayload.legacyFormData) {
|
||||
@@ -370,6 +369,26 @@ export class NostrService {
|
||||
} else {
|
||||
detail.formData = publishPayload;
|
||||
}
|
||||
|
||||
let nip71Result = null;
|
||||
let legacyResult = null;
|
||||
|
||||
try {
|
||||
nip71Result = await this.nostrClient.publishNip71Video(
|
||||
publishPayload,
|
||||
pubkey
|
||||
);
|
||||
legacyResult = await this.nostrClient.publishVideo(
|
||||
publishPayload,
|
||||
pubkey
|
||||
);
|
||||
} catch (error) {
|
||||
detail.error = error;
|
||||
throw error;
|
||||
}
|
||||
|
||||
const result = { legacy: legacyResult, nip71: nip71Result };
|
||||
detail.result = result;
|
||||
this.emit("videos:published", detail);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user