mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28: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}`
|
||||
: undefined,
|
||||
duration: attachment.duration || undefined,
|
||||
length: attachment.size?.toString() || undefined,
|
||||
length: undefined,
|
||||
aspect:
|
||||
attachment.width && attachment.height
|
||||
? attachment.width / attachment.height
|
||||
|
|
|
|||
|
|
@ -112,11 +112,9 @@ export default (app: Hono) =>
|
|||
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 = "";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue