diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-11-07 12:12:43 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-11-07 12:12:43 +0900 |
| commit | 665fa7f2aa80a726f36f834d14ecac8eaff3f944 (patch) | |
| tree | 522755781963d6959214eb966c329960815fa0e7 /src/server/api | |
| parent | Merge branch 'develop' of https://github.com/syuilo/misskey into develop (diff) | |
| download | sharkey-665fa7f2aa80a726f36f834d14ecac8eaff3f944.tar.gz sharkey-665fa7f2aa80a726f36f834d14ecac8eaff3f944.tar.bz2 sharkey-665fa7f2aa80a726f36f834d14ecac8eaff3f944.zip | |
[API] Improve drive/files/upload_from_url
Diffstat (limited to 'src/server/api')
| -rw-r--r-- | src/server/api/endpoints/drive/files/upload_from_url.ts | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/server/api/endpoints/drive/files/upload_from_url.ts b/src/server/api/endpoints/drive/files/upload_from_url.ts index cacb96fa3f..a8faab1d73 100644 --- a/src/server/api/endpoints/drive/files/upload_from_url.ts +++ b/src/server/api/endpoints/drive/files/upload_from_url.ts @@ -11,7 +11,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 10 + max: 60 }, requireCredential: true, @@ -29,9 +29,26 @@ export const meta = { default: null as any as any, transform: transform }, + + isSensitive: { + validator: $.bool.optional, + default: false, + desc: { + 'ja-JP': 'このメディアが「閲覧注意」(NSFW)かどうか', + 'en-US': 'Whether this media is NSFW' + } + }, + + force: { + validator: $.bool.optional, + default: false, + desc: { + 'ja-JP': 'true にすると、同じハッシュを持つファイルが既にアップロードされていても強制的にファイルを作成します。', + } + } } }; export default define(meta, (ps, user) => new Promise(async (res, rej) => { - res(pack(await uploadFromUrl(ps.url, user, ps.folderId))); + res(pack(await uploadFromUrl(ps.url, user, ps.folderId, null, ps.isSensitive, ps.force))); })); |