From 324cc5509ee1918448b43749d431be5ac36753b7 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Mon, 25 Sep 2023 18:46:17 +0200 Subject: [PATCH] fix: adding description not working on media --- .../src/server/api/mastodon/MastodonApiServerService.ts | 5 ++--- packages/backend/src/server/api/mastodon/endpoints/status.ts | 2 +- packages/megalodon/src/misskey.ts | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts index c96c7a461..128cb3491 100644 --- a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts +++ b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts @@ -143,7 +143,7 @@ export class MastodonApiServerService { const data = await client.uploadMedia(multipartData); reply.send(convertAttachment(data.data as Entity.Attachment)); } catch (e: any) { - console.error(e); + /* console.error(e); */ reply.code(401).send(e.response.data); } }); @@ -158,11 +158,10 @@ export class MastodonApiServerService { reply.code(401).send({ error: 'No image' }); return; } - console.error(_request.body); const data = await client.uploadMedia(multipartData, _request.body!); reply.send(convertAttachment(data.data as Entity.Attachment)); } catch (e: any) { - console.error(e); + /* console.error(e); */ reply.code(401).send(e.response.data); } }); diff --git a/packages/backend/src/server/api/mastodon/endpoints/status.ts b/packages/backend/src/server/api/mastodon/endpoints/status.ts index d21f48aba..991adacb0 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/status.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/status.ts @@ -377,7 +377,7 @@ export class ApiStatusMastodon { const data = await client.updateMedia(convertId(_request.params.id, IdType.SharkeyId), _request.body as any); reply.send(convertAttachment(data.data)); } catch (e: any) { - console.error(e); + /* console.error(e); */ reply.code(401).send(e.response.data); } }); diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index 23506d6e6..c4374adcb 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -1446,6 +1446,11 @@ export default class Misskey implements MegalodonInterface { isSensitive: options.is_sensitive }) } + if (options.description !== undefined) { + params = Object.assign(params, { + comment: options.description, + }); + } } return this.client .post('/api/drive/files/update', params)