summaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
authorJustZvan <justzvan@justzvan.xyz>2026-04-06 15:32:17 +0200
committerJustZvan <justzvan@justzvan.xyz>2026-04-06 15:32:17 +0200
commit6a5a165a035459af601006286e4a6e46ded1487c (patch)
tree40b9841f8121d3f45450fd792a7e5b5e58e65490 /src/routes
parent18efc1e708821fd1f36532d659b928c320f4a143 (diff)
feat: gallery scanning preferences
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/parent.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/routes/parent.ts b/src/routes/parent.ts
index dd94d6e..d800dbf 100644
--- a/src/routes/parent.ts
+++ b/src/routes/parent.ts
@@ -1,7 +1,7 @@
import express from "express";
import { authParent } from "../middleware/auth";
import { db } from "../db/db";
-import { deviceConfig, linkedDevices, users, alerts } from "../db/schema";
+import { deviceConfig, linkedDevices, users, alerts, galleryScanningMode } from "../db/schema";
import { eq, and, desc } from "drizzle-orm";
import { isValidPushToken } from "../notifications/push";
import { logger } from "../lib/pino";
@@ -23,12 +23,13 @@ const ControlsUpdateSchema = z.object({
"disable_buddy",
"adult_sites",
"new_people",
+ "gallery_scanning_mode",
"block_strangers",
"notify_dangerous_messages",
"notify_new_contact_added",
"family_link_anti_circumvention",
]),
- value: z.boolean(),
+ value: z.any(),
});
/** Validates device nickname changes */
@@ -358,6 +359,12 @@ function createParentRouter(
description: "Notify when a new contact is added.",
defaultValue: cfg.notifyNewContactAdded,
},
+ {
+ key: "gallery_scanning_mode",
+ title: "Gallery scanning",
+ description: "Scan gallery for inappropriate images",
+ defaultValue: cfg.galleryScanningMode,
+ }
],
});
} catch (e) {
@@ -411,6 +418,7 @@ function createParentRouter(
notify_dangerous_messages: "notifyDangerousMessages",
notify_new_contact_added: "notifyNewContactAdded",
family_link_anti_circumvention: "familyLinkAntiCircumvention",
+ gallery_scanning_mode: "galleryScanningMode"
};
const dbKey = keyMap[key];