Add more routes for media upload

This commit is contained in:
Jesse Wierzbinski 2023-11-21 17:00:14 -10:00
parent 4afd939b18
commit 930b84826b
No known key found for this signature in database
5 changed files with 138 additions and 6 deletions

View file

@ -27,9 +27,28 @@ export const attachmentToAPI = (
width: attachment.width || undefined,
height: attachment.height || undefined,
fps: attachment.fps || undefined,
size: attachment.size?.toString() || undefined,
size:
attachment.width && attachment.height
? `${attachment.width}x${attachment.height}`
: undefined,
duration: attachment.duration || undefined,
length: attachment.size?.toString() || undefined,
aspect:
attachment.width && attachment.height
? attachment.width / attachment.height
: undefined,
original: {
width: attachment.width || undefined,
height: attachment.height || undefined,
size:
attachment.width && attachment.height
? `${attachment.width}x${attachment.height}`
: undefined,
aspect:
attachment.width && attachment.height
? attachment.width / attachment.height
: undefined,
},
// Idk whether size or length is the right value
},
description: attachment.description,