forked from FoundKeyGang/FoundKey
translating comments, cleanup
This commit is contained in:
parent
fdf30f60e6
commit
8c2b7e20b2
2 changed files with 9 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue