fix (backend, Mastodon API): add 'meta.original' field to media attachments
addresses https://github.com/whitescent/Mastify/pull/102
This commit is contained in:
parent
86f2e32c66
commit
17fb05430e
1 changed files with 14 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
import { Entity } from "megalodon";
|
||||
import type { Entity } from "megalodon";
|
||||
import { toMastodonId } from "backend-rs";
|
||||
|
||||
function simpleConvert(data: any) {
|
||||
|
@ -15,7 +15,19 @@ export function convertAnnouncement(announcement: Entity.Announcement) {
|
|||
return simpleConvert(announcement);
|
||||
}
|
||||
export function convertAttachment(attachment: Entity.Attachment) {
|
||||
return simpleConvert(attachment);
|
||||
const converted = simpleConvert(attachment);
|
||||
// ref: https://github.com/whitescent/Mastify/pull/102
|
||||
if (converted.meta == null) return converted;
|
||||
const result = {
|
||||
...converted,
|
||||
meta: {
|
||||
...converted.meta,
|
||||
original: {
|
||||
...converted.meta,
|
||||
},
|
||||
},
|
||||
};
|
||||
return result;
|
||||
}
|
||||
export function convertFilter(filter: Entity.Filter) {
|
||||
return simpleConvert(filter);
|
||||
|
|
Loading…
Reference in a new issue