summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/DriveService.ts
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2024-05-30 14:22:00 +0000
committerAmelia Yukii <amelia.yukii@shourai.de>2024-05-30 14:22:00 +0000
commit3050dcbef7f43e7ad2a07a60a6da175023527d89 (patch)
tree8bdb6ebeafee17927a44142a1f70ffe774e46e33 /packages/backend/src/core/DriveService.ts
parentmerge: always align code to the left - fixes #436 (!453) (diff)
downloadsharkey-3050dcbef7f43e7ad2a07a60a6da175023527d89.tar.gz
sharkey-3050dcbef7f43e7ad2a07a60a6da175023527d89.tar.bz2
sharkey-3050dcbef7f43e7ad2a07a60a6da175023527d89.zip
set the correct "marked an NSFW" when loading admin-user
Diffstat (limited to 'packages/backend/src/core/DriveService.ts')
-rw-r--r--packages/backend/src/core/DriveService.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/backend/src/core/DriveService.ts b/packages/backend/src/core/DriveService.ts
index f64568ee9a..4203b03c74 100644
--- a/packages/backend/src/core/DriveService.ts
+++ b/packages/backend/src/core/DriveService.ts
@@ -632,7 +632,8 @@ export class DriveService {
@bindThis
public async updateFile(file: MiDriveFile, values: Partial<MiDriveFile>, updater: MiUser) {
- const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw;
+ const profile = await this.userProfilesRepository.findOneBy({ userId: file.userId });
+ const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw || (profile !== null && profile!.alwaysMarkNsfw);
if (values.name != null && !this.driveFileEntityService.validateFileName(values.name)) {
throw new DriveService.InvalidFileNameError();