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)) {
throw new Error('no-free-space');
} else {
// (アバターまたはバナーを含まず)最も古いファイルを削除する
// delete oldest file (excluding banner and avatar)
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> {
// リモートファイル期限切れ削除後は直リンクにする
if (isExpired && file.userHost !== null && file.uri != null) {
// Turn into a direct link after expiring a remote file.
if (isExpired && file.userHost != null && file.uri != null) {
const id = uuid();
DriveFiles.update(file.id, {
isLink: true,
url: file.uri,
thumbnailUrl: null,
webpublicUrl: null,
storedInternal: false,
// ローカルプロキシ用
accessKey: uuid(),
thumbnailAccessKey: 'thumbnail-' + uuid(),
webpublicAccessKey: 'webpublic-' + uuid(),
accessKey: id,
thumbnailAccessKey: 'thumbnail-' + id,
webpublicAccessKey: 'webpublic-' + id,
});
} else {
DriveFiles.delete(file.id);
}
// 統計を更新
// update statistics
driveChart.update(file, false);
perUserDriveChart.update(file, false);
if (file.userHost !== null) {
if (file.userHost != null) {
instanceChart.updateDrive(file, false);
}
}