From 4e5bb1194a30724806f64926111f2d1d92edcafb Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Fri, 30 Jun 2023 23:35:45 -0700 Subject: [PATCH] chore: :art: format --- .../backend/src/services/drive/add-file.ts | 11 ++- packages/client/src/components/MkNote.vue | 11 ++- .../client/src/components/MkUrlPreview.vue | 74 +++++++++++-------- 3 files changed, 59 insertions(+), 37 deletions(-) diff --git a/packages/backend/src/services/drive/add-file.ts b/packages/backend/src/services/drive/add-file.ts index b5ba22137..b9991f494 100644 --- a/packages/backend/src/services/drive/add-file.ts +++ b/packages/backend/src/services/drive/add-file.ts @@ -382,12 +382,17 @@ async function expireOldFile(user: IRemoteUser, driveCapacity: number) { } //This selete is hard coded, be careful if change database schema - q.addSelect('SUM("file"."size") OVER (ORDER BY "file"."id" DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)', 'acc_usage'); + q.addSelect( + 'SUM("file"."size") OVER (ORDER BY "file"."id" DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)', + "acc_usage", + ); q.orderBy("file.id", "ASC"); const fileList = await q.getRawMany(); - const exceedFileIds = fileList.filter((x: any) => x.acc_usage > driveCapacity).map((x: any) => x.file_id); + const exceedFileIds = fileList + .filter((x: any) => x.acc_usage > driveCapacity) + .map((x: any) => x.file_id); for (const fileId of exceedFileIds) { const file = await DriveFiles.findOneBy({ id: fileId }); @@ -536,7 +541,7 @@ export async function addFile({ // (アバターまたはバナーを含まず)最も古いファイルを削除する expireOldFile( (await Users.findOneByOrFail({ id: user.id })) as IRemoteUser, - driveCapacity - info.size + driveCapacity - info.size, ); } } diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index de3b173ba..112303584 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -224,7 +224,12 @@ -