From 8f219557d4a4c755272d3b44312e38f8dd6b268e Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Sun, 24 Sep 2023 23:46:02 +0200 Subject: [PATCH] upd: megalodon package fix lines, enable error on media --- .../src/server/api/mastodon/MastodonApiServerService.ts | 4 ++-- packages/megalodon/src/misskey/api_client.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts index 128cb3491a..0e35974847 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); } }); @@ -161,7 +161,7 @@ export class MastodonApiServerService { 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/megalodon/src/misskey/api_client.ts b/packages/megalodon/src/misskey/api_client.ts index 70e12cc152..8800724385 100644 --- a/packages/megalodon/src/misskey/api_client.ts +++ b/packages/megalodon/src/misskey/api_client.ts @@ -123,11 +123,11 @@ namespace MisskeyAPI { noindex: null, suspended: null, limited: null, - created_at: u.createdAt, + created_at: u.createdAt ? u.createdAt : new Date().toUTCString(), followers_count: u.followersCount, following_count: u.followingCount, statuses_count: u.notesCount, - note: u.description, + note: u.description ? u.description : '', url: acct, avatar: u.avatarUrl, avatar_static: u.avatarColor,