diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-01-11 08:10:39 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-01-11 08:10:39 +0900 |
| commit | dd77a6194e4fff8f581824a0caa82c27f7bb80b4 (patch) | |
| tree | 7c1cf196ae1a1a17fa9f5d2b4300e40b58ed8c25 /src/server/api/endpoints | |
| parent | 管理画面でユーザーを状態でフィルタできるように (#3873) (diff) | |
| download | sharkey-dd77a6194e4fff8f581824a0caa82c27f7bb80b4.tar.gz sharkey-dd77a6194e4fff8f581824a0caa82c27f7bb80b4.tar.bz2 sharkey-dd77a6194e4fff8f581824a0caa82c27f7bb80b4.zip | |
Hide NSFW in Photos (#3875)
Diffstat (limited to 'src/server/api/endpoints')
| -rw-r--r-- | src/server/api/endpoints/users/notes.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/server/api/endpoints/users/notes.ts b/src/server/api/endpoints/users/notes.ts index 6c336683ab..7d73fde1c5 100644 --- a/src/server/api/endpoints/users/notes.ts +++ b/src/server/api/endpoints/users/notes.ts @@ -124,6 +124,14 @@ export const meta = { 'ja-JP': '指定された種類のファイルが添付された投稿のみを取得します' } }, + + excludeNsfw: { + validator: $.bool.optional, + default: false, + desc: { + 'ja-JP': 'true にすると、NSFW指定されたファイルを除外します(fileTypeが指定されている場合のみ有効)' + } + }, } }; @@ -233,6 +241,12 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => { query['_files.contentType'] = { $in: ps.fileType }; + + if (ps.excludeNsfw) { + query['_files.metadata.isSensitive'] = { + $ne: true + }; + } } //#endregion |