mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 11:23:09 +02:00
isRemote --> isLink
This commit is contained in:
parent
74a4bd704c
commit
ea06665c51
4 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue