mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-21 14:24:31 +01:00
Remove unattached_media table, replace with LRUCache, fix media upload order problem
This commit is contained in:
@@ -3,9 +3,9 @@ import { getUrlMediaType } from '@/utils/media.ts';
|
||||
|
||||
/** Render Mastodon media attachment. */
|
||||
function renderAttachment(
|
||||
media: { id?: string; data: string[][] },
|
||||
media: { id?: string; tags: string[][] },
|
||||
): (MastodonAttachment & { cid?: string }) | undefined {
|
||||
const { id, data: tags } = media;
|
||||
const { id, tags } = media;
|
||||
|
||||
const url = tags.find(([name]) => name === 'url')?.[1];
|
||||
|
||||
|
||||
@@ -125,9 +125,9 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
|
||||
pinned: Boolean(pinEvent),
|
||||
reblog: null,
|
||||
application: null,
|
||||
media_attachments: media.map((m) => renderAttachment({ data: m })).filter((m): m is MastodonAttachment =>
|
||||
Boolean(m)
|
||||
),
|
||||
media_attachments: media
|
||||
.map((m) => renderAttachment({ tags: m }))
|
||||
.filter((m): m is MastodonAttachment => Boolean(m)),
|
||||
mentions,
|
||||
tags: [],
|
||||
emojis: renderEmojis(event),
|
||||
|
||||
Reference in New Issue
Block a user