diff --git a/src/models/drive-file.ts b/src/models/drive-file.ts index 718e8d0dc6..66be0fb2fc 100644 --- a/src/models/drive-file.ts +++ b/src/models/drive-file.ts @@ -28,7 +28,8 @@ export type IMetadata = { _user: any; folderId: mongo.ObjectID; comment: string; - uri: string; + uri?: string; + url?: string; deletedAt?: Date; isExpired?: boolean; }; diff --git a/src/remote/activitypub/models/image.ts b/src/remote/activitypub/models/image.ts index 3f522f9b52..0d5a690c6c 100644 --- a/src/remote/activitypub/models/image.ts +++ b/src/remote/activitypub/models/image.ts @@ -24,7 +24,7 @@ export async function createImage(actor: IRemoteUser, value): Promise => { log(`registering ${name} (user: ${getAcct(user)}, path: ${path})`); @@ -296,6 +297,10 @@ const addFile = async ( properties: properties } as IMetadata; + if (url !== null) { + metadata.url = url; + } + if (uri !== null) { metadata.uri = uri; } diff --git a/src/services/drive/upload-from-url.ts b/src/services/drive/upload-from-url.ts index 08e0397706..ad2620c036 100644 --- a/src/services/drive/upload-from-url.ts +++ b/src/services/drive/upload-from-url.ts @@ -43,7 +43,7 @@ export default async (url, user, folderId = null, uri = null): Promise