settings: add auto-processing toggle

This commit is contained in:
2026-04-18 10:52:26 +02:00
parent 13b2630a09
commit d8d1b43556
+21
View File
@@ -461,6 +461,7 @@ export function SettingsPage() {
const [clearStatus, setClearStatus] = useState("");
const [audLangs, setAudLangs] = useState<string[]>([]);
const [audSaved, setAudSaved] = useState("");
const [autoProcessing, setAutoProcessing] = useState(false);
const langsLoadedRef = useRef(false);
const load = useCallback(() => {
@@ -470,6 +471,7 @@ export function SettingsPage() {
.then((d) => {
settingsCache = d;
setData(d);
setAutoProcessing(d.config.auto_processing === "1");
if (!langsLoadedRef.current) {
let parsed: string[] = [];
try {
@@ -585,6 +587,25 @@ export function SettingsPage() {
{/* Schedule */}
<ScheduleSection />
{/* Auto-processing */}
<SectionCard
title="Processing"
subtitle="Control how new library items are handled after a scan."
>
<label className="flex items-center gap-2 text-sm text-gray-700">
<input
type="checkbox"
checked={autoProcessing}
onChange={async (e) => {
const next = e.target.checked;
setAutoProcessing(next);
await api.post("/api/settings/auto-processing", { enabled: next });
}}
/>
Auto-process new items distribute Inbox immediately after scan
</label>
</SectionCard>
{/* Audio languages */}
<SectionCard
title="Audio Languages"