mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 05:57:32 -07:00
Hide NSFW in Photos (#3875)
This commit is contained in:
parent
e5782a7c30
commit
65e34cef83
4 changed files with 18 additions and 0 deletions
|
@ -169,6 +169,7 @@ export default Vue.extend({
|
|||
this.$root.api('users/notes', {
|
||||
userId: this.user.id,
|
||||
fileType: image,
|
||||
excludeNsfw: !this.$store.state.device.alwaysShowNsfw,
|
||||
limit: 9,
|
||||
untilDate: new Date().getTime() + 1000 * 86400 * 365
|
||||
}).then(notes => {
|
||||
|
|
|
@ -29,9 +29,11 @@ export default Vue.extend({
|
|||
'image/png',
|
||||
'image/gif'
|
||||
];
|
||||
|
||||
this.$root.api('users/notes', {
|
||||
userId: this.user.id,
|
||||
fileType: image,
|
||||
excludeNsfw: !this.$store.state.device.alwaysShowNsfw,
|
||||
limit: 9,
|
||||
untilDate: new Date().getTime() + 1000 * 86400 * 365
|
||||
}).then(notes => {
|
||||
|
|
|
@ -34,6 +34,7 @@ export default Vue.extend({
|
|||
this.$root.api('users/notes', {
|
||||
userId: this.user.id,
|
||||
fileType: image,
|
||||
excludeNsfw: !this.$store.state.device.alwaysShowNsfw,
|
||||
limit: 9,
|
||||
untilDate: new Date().getTime() + 1000 * 86400 * 365
|
||||
}).then(notes => {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue