diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-01-31 13:40:59 -0500 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-02-08 13:17:50 -0500 |
| commit | 1126c096691a2e8dcac3f500e812dc5d6d71cb65 (patch) | |
| tree | c56aa289e349a10dd78ca089a833e7aaff43f34b /packages/backend/src/server/api | |
| parent | fix mastodon media attachment conversion (resolves #495) (diff) | |
| download | sharkey-1126c096691a2e8dcac3f500e812dc5d6d71cb65.tar.gz sharkey-1126c096691a2e8dcac3f500e812dc5d6d71cb65.tar.bz2 sharkey-1126c096691a2e8dcac3f500e812dc5d6d71cb65.zip | |
make convertAttachment match file->attachment schema
Diffstat (limited to 'packages/backend/src/server/api')
| -rw-r--r-- | packages/backend/src/server/api/mastodon/converters.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/backend/src/server/api/mastodon/converters.ts b/packages/backend/src/server/api/mastodon/converters.ts index c3694f3580..b6ff5bc59a 100644 --- a/packages/backend/src/server/api/mastodon/converters.ts +++ b/packages/backend/src/server/api/mastodon/converters.ts @@ -362,15 +362,18 @@ export function convertAttachment(attachment: Entity.Attachment): MastodonEntity ...attachment, meta: attachment.meta ? { ...attachment.meta, - original: attachment.meta.original ?? { - width: attachment.meta.width, - height: attachment.meta.height, + original: { + ...attachment.meta.original, + width, + height, size, aspect, frame_rate: String(attachment.meta.fps), duration: attachment.meta.duration, bitrate: attachment.meta.audio_bitrate ? parseInt(attachment.meta.audio_bitrate) : undefined, }, + width, + height, size, aspect, } : null, |