mirror of
https://github.com/versia-pub/server.git
synced 2025-12-07 08:48:19 +01:00
fix(api): 🐛 Prevent non-images uploaded from not being saved to object storage
This commit is contained in:
parent
268ced27ef
commit
f4af0e2407
|
|
@ -39,7 +39,7 @@ export const attachmentToAPI = (
|
||||||
? `${attachment.width}x${attachment.height}`
|
? `${attachment.width}x${attachment.height}`
|
||||||
: undefined,
|
: undefined,
|
||||||
duration: attachment.duration || undefined,
|
duration: attachment.duration || undefined,
|
||||||
length: attachment.size?.toString() || undefined,
|
length: undefined,
|
||||||
aspect:
|
aspect:
|
||||||
attachment.width && attachment.height
|
attachment.width && attachment.height
|
||||||
? attachment.width / attachment.height
|
? attachment.width / attachment.height
|
||||||
|
|
|
||||||
|
|
@ -112,11 +112,9 @@ export default (app: Hono) =>
|
||||||
throw new Error("Invalid media backend");
|
throw new Error("Invalid media backend");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isImage) {
|
|
||||||
const { path } = await mediaManager.addFile(file);
|
const { path } = await mediaManager.addFile(file);
|
||||||
|
|
||||||
url = getUrl(path, config);
|
url = getUrl(path, config);
|
||||||
}
|
|
||||||
|
|
||||||
let thumbnailUrl = "";
|
let thumbnailUrl = "";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue