brevity
This commit is contained in:
parent
1dd74500f2
commit
dbf653e7cd
2 changed files with 8 additions and 24 deletions
|
|
@ -33,13 +33,13 @@ const fetchVideoRecord = async (
|
||||||
};
|
};
|
||||||
|
|
||||||
const resolveVideoURL = async (
|
const resolveVideoURL = async (
|
||||||
did: `did:${string}`,
|
repo: `did:${string}`,
|
||||||
blob: string
|
blob: string
|
||||||
): Promise<string> => {
|
): Promise<string> => {
|
||||||
const xrpc = new XRPC<VideoLexiconUniverse>(globalThis.location.href);
|
|
||||||
try {
|
try {
|
||||||
|
const xrpc = new XRPC<VideoLexiconUniverse>(globalThis.location.href);
|
||||||
const res = await xrpc.call("blue.cerulea.video.fetchVideo", {
|
const res = await xrpc.call("blue.cerulea.video.fetchVideo", {
|
||||||
input: { repo: did, blob },
|
input: { repo, blob },
|
||||||
});
|
});
|
||||||
return `/user-content/${res.filename}`;
|
return `/user-content/${res.filename}`;
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,8 @@ export const videoLexicon = {
|
||||||
accept: ["video/mp4", "video/webm"],
|
accept: ["video/mp4", "video/webm"],
|
||||||
maxSize: 536870912,
|
maxSize: 536870912,
|
||||||
},
|
},
|
||||||
title: {
|
title: { type: "string", maxGraphemes: 300, maxLength: 3000 },
|
||||||
type: "string",
|
description: { type: "string" },
|
||||||
maxGraphemes: 300,
|
|
||||||
maxLength: 3000,
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
type: "string",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -42,14 +36,8 @@ export const fetchVideoLexicon = {
|
||||||
type: "object",
|
type: "object",
|
||||||
required: ["repo", "blob"],
|
required: ["repo", "blob"],
|
||||||
properties: {
|
properties: {
|
||||||
repo: {
|
repo: { type: "string", format: "did" },
|
||||||
type: "string",
|
blob: { type: "string", format: "cid" },
|
||||||
format: "did",
|
|
||||||
},
|
|
||||||
blob: {
|
|
||||||
type: "string",
|
|
||||||
format: "cid",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -58,11 +46,7 @@ export const fetchVideoLexicon = {
|
||||||
schema: {
|
schema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
required: ["filename"],
|
required: ["filename"],
|
||||||
properties: {
|
properties: { filename: { type: "string" } },
|
||||||
filename: {
|
|
||||||
type: "string",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
errors: [{ name: "Denied" }],
|
errors: [{ name: "Denied" }],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue