diff --git a/packages/backend/src/services/drive/add-file.ts b/packages/backend/src/services/drive/add-file.ts index b5ba221372..b9991f4949 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 de3b173ba2..1123035849 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -224,7 +224,12 @@ -