From 6a5a165a035459af601006286e4a6e46ded1487c Mon Sep 17 00:00:00 2001 From: JustZvan Date: Mon, 6 Apr 2026 15:32:17 +0200 Subject: feat: gallery scanning preferences --- src/routes/parent.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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]; -- cgit v1.2.3