translating comments, cleanup

This commit is contained in:
Johann150 2023-01-09 20:44:01 +01:00
parent fdf30f60e6
commit 8c2b7e20b2
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
2 changed files with 9 additions and 9 deletions

View file

@ -384,7 +384,7 @@ export async function addFile({
if (Users.isLocalUser(user)) { if (Users.isLocalUser(user)) {
throw new Error('no-free-space'); throw new Error('no-free-space');
} else { } else {
// (アバターまたはバナーを含まず)最も古いファイルを削除する // delete oldest file (excluding banner and avatar)
deleteOldFile(await Users.findOneByOrFail({ id: user.id }) as IRemoteUser); deleteOldFile(await Users.findOneByOrFail({ id: user.id }) as IRemoteUser);
} }
} }

View file

@ -64,27 +64,27 @@ export async function deleteFileSync(file: DriveFile, isExpired = false): Promis
} }
async function postProcess(file: DriveFile, isExpired = false): Promise<void> { async function postProcess(file: DriveFile, isExpired = false): Promise<void> {
// リモートファイル期限切れ削除後は直リンクにする // Turn into a direct link after expiring a remote file.
if (isExpired && file.userHost !== null && file.uri != null) { if (isExpired && file.userHost != null && file.uri != null) {
const id = uuid();
DriveFiles.update(file.id, { DriveFiles.update(file.id, {
isLink: true, isLink: true,
url: file.uri, url: file.uri,
thumbnailUrl: null, thumbnailUrl: null,
webpublicUrl: null, webpublicUrl: null,
storedInternal: false, storedInternal: false,
// ローカルプロキシ用 accessKey: id,
accessKey: uuid(), thumbnailAccessKey: 'thumbnail-' + id,
thumbnailAccessKey: 'thumbnail-' + uuid(), webpublicAccessKey: 'webpublic-' + id,
webpublicAccessKey: 'webpublic-' + uuid(),
}); });
} else { } else {
DriveFiles.delete(file.id); DriveFiles.delete(file.id);
} }
// 統計を更新 // update statistics
driveChart.update(file, false); driveChart.update(file, false);
perUserDriveChart.update(file, false); perUserDriveChart.update(file, false);
if (file.userHost !== null) { if (file.userHost != null) {
instanceChart.updateDrive(file, false); instanceChart.updateDrive(file, false);
} }
} }