From c10f7856147e656faadee97a22e52e31f1e9087e Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Mon, 25 Sep 2023 05:22:45 +0200 Subject: [PATCH] upd: get alt and blurhash on media --- packages/megalodon/src/misskey.ts | 2 +- packages/megalodon/src/misskey/api_client.ts | 4 ++-- packages/megalodon/src/misskey/entities/file.ts | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index 4807fcdfb..0ea66cb49 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -2178,7 +2178,7 @@ export default class Misskey implements MegalodonInterface { public async getInstanceCustomEmojis(): Promise>> { return this.client .get<{ emojis: Array }>('/api/emojis') - .then(res => ({ ...res, data: res.data.emojis && res.data.emojis.length > 0 ? res.data.emojis.map(e => MisskeyAPI.Converter.emoji(e)) : [] })) + .then(res => ({ ...res, data: res.data.emojis.map(e => MisskeyAPI.Converter.emoji(e)) })) } // ====================================== diff --git a/packages/megalodon/src/misskey/api_client.ts b/packages/megalodon/src/misskey/api_client.ts index 36746c1e8..a9806c0ab 100644 --- a/packages/megalodon/src/misskey/api_client.ts +++ b/packages/megalodon/src/misskey/api_client.ts @@ -204,8 +204,8 @@ namespace MisskeyAPI { width: f.properties.width, height: f.properties.height }, - description: null, - blurhash: null + description: f.comment ? f.comment : null, + blurhash: f.blurhash ? f.blurhash : null } } diff --git a/packages/megalodon/src/misskey/entities/file.ts b/packages/megalodon/src/misskey/entities/file.ts index 6e4e09eee..3bb0272fd 100644 --- a/packages/megalodon/src/misskey/entities/file.ts +++ b/packages/megalodon/src/misskey/entities/file.ts @@ -13,6 +13,8 @@ namespace MisskeyEntity { avgColor: string } url: string + comment?: string + blurhash?: string thumbnailUrl: string } }