Compare commits

...

2 Commits
2.1.4 ... 2.2.0

Author SHA1 Message Date
syuilo
d9cdc1f079 2.2.0 2018-05-04 18:32:13 +09:00
syuilo
414c600356 ファイルのURLを保存するように 2018-05-04 18:32:03 +09:00
5 changed files with 10 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "2.1.4",
"version": "2.2.0",
"clientVersion": "1.0.5193",
"codename": "nighthike",
"main": "./built/index.js",

View File

@@ -28,7 +28,8 @@ export type IMetadata = {
_user: any;
folderId: mongo.ObjectID;
comment: string;
uri: string;
uri?: string;
url?: string;
deletedAt?: Date;
isExpired?: boolean;
};

View File

@@ -24,7 +24,7 @@ export async function createImage(actor: IRemoteUser, value): Promise<IDriveFile
log(`Creating the Image: ${image.url}`);
return await uploadFromUrl(image.url, actor);
return await uploadFromUrl(image.url, actor, null, image.url);
}
/**

View File

@@ -62,6 +62,7 @@ const addFile = async (
comment: string = null,
folderId: mongodb.ObjectID = null,
force: boolean = false,
url: string = null,
uri: string = null
): Promise<IDriveFile> => {
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;
}

View File

@@ -43,7 +43,7 @@ export default async (url, user, folderId = null, uri = null): Promise<IDriveFil
let error;
try {
driveFile = await create(user, path, name, null, folderId, false, uri);
driveFile = await create(user, path, name, null, folderId, false, url, uri);
log(`created: ${driveFile._id}`);
} catch (e) {
error = e;