Merge pull request #251 from koehn/main

Fix for cloudflare#248
pull/273/head
Sven Sauleau 2023-02-10 18:44:56 +00:00 zatwierdzone przez GitHub
commit e88a55a7e0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -16,8 +16,9 @@ export function fromObject(obj: APObject): MediaAttachment {
}
}
const imageTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/webp']
export function fromObjectDocument(obj: Document): MediaAttachment {
if (obj.mediaType === 'image/jpeg' || obj.mediaType === 'image/png') {
if (imageTypes.includes(obj.mediaType as string)) {
return fromObjectImage(obj)
} else if (obj.mediaType === 'video/mp4') {
return fromObjectVideo(obj)