1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-28 06:48:32 +09:00

isRemote --> isLink

This commit is contained in:
syuilo 2019-04-09 23:07:08 +09:00
parent 74a4bd704c
commit ea06665c51
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
4 changed files with 5 additions and 5 deletions

View File

@ -150,5 +150,5 @@ export class DriveFile {
default: false,
comment: 'Whether the DriveFile is direct link to remote server.'
})
public isRemote: boolean;
public isLink: boolean;
}

View File

@ -40,7 +40,7 @@ export async function createImage(actor: IRemoteUser, value: any): Promise<Drive
throw e;
}
if (file.isRemote) {
if (file.isLink) {
// URLが異なっている場合、同じ画像が以前に異なるURLで登録されていたということなので、
// URLを更新する
if (file.url !== image.url) {

View File

@ -375,7 +375,7 @@ export default async function(
file.folderId = folder !== null ? folder.id : null;
file.comment = comment;
file.properties = properties;
file.isRemote = isLink;
file.isLink = isLink;
file.isSensitive = Users.isLocalUser(user) && user.alwaysMarkNsfw ? true :
(sensitive !== null && sensitive !== undefined)
? sensitive

View File

@ -16,7 +16,7 @@ export default async function(file: DriveFile, isExpired = false) {
if (file.webpublicUrl) {
InternalStorage.del(file.webpublicAccessKey);
}
} else if (!file.isRemote) {
} else if (!file.isLink) {
const minio = new Minio.Client(config.drive.config);
await minio.removeObject(config.drive.bucket, file.accessKey);
@ -33,7 +33,7 @@ export default async function(file: DriveFile, isExpired = false) {
// リモートファイル期限切れ削除後は直リンクにする
if (isExpired && file.userHost !== null) {
DriveFiles.update(file.id, {
isRemote: true,
isLink: true,
url: file.uri,
thumbnailUrl: null,
webpublicUrl: null