diff --git a/locales/ca-ES.yml b/locales/ca-ES.yml index 4e8a475282..208ccb1598 100644 --- a/locales/ca-ES.yml +++ b/locales/ca-ES.yml @@ -349,6 +349,7 @@ _2fa: deixin de funcionar whyTOTPOnlyRenew: L’aplicació d’autenticació no es pot eliminar sempre que es hi hagi una clau de seguretat registrada. + token: Token 2FA _widgets: notifications: "Notificacions" timeline: "Línia de temps" diff --git a/packages/backend/src/server/api/endpoints/patrons.ts b/packages/backend/src/server/api/endpoints/patrons.ts index 944858694a..ac914daa12 100644 --- a/packages/backend/src/server/api/endpoints/patrons.ts +++ b/packages/backend/src/server/api/endpoints/patrons.ts @@ -11,19 +11,25 @@ export const meta = { export const paramDef = { type: "object", - properties: {}, + properties: { + forceUpdate: { type: "boolean", default: false }, + }, required: [], } as const; -export default define(meta, paramDef, async () => { +export default define(meta, paramDef, async (ps) => { let patrons; const cachedPatrons = await redisClient.get("patrons"); - if (cachedPatrons) { + if (!ps.forceUpdate && cachedPatrons) { patrons = JSON.parse(cachedPatrons); } else { patrons = await fetch( "https://codeberg.org/calckey/calckey/raw/branch/develop/patrons.json", - ).then((response) => response.json()); + ) + .then((response) => response.json()) + .catch(() => { + patrons = cachedPatrons ? JSON.parse(cachedPatrons) : []; + }); await redisClient.set("patrons", JSON.stringify(patrons), "EX", 3600); } 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 @@ -