resources

This commit is contained in:
2026-02-24 16:44:22 +00:00
parent d6ffe43a11
commit 05f0d0e8f7
39 changed files with 1385 additions and 1057 deletions
+4
View File
@@ -1,5 +1,6 @@
import { createRouter } from '../../create-router';
import { settingsPath } from './server-settings';
import { readResourceConfig } from './resources';
type OcrConfig = {
url: string;
@@ -7,6 +8,9 @@ type OcrConfig = {
};
export async function readOcrConfig(): Promise<OcrConfig | undefined> {
const config = await readResourceConfig('optical-character-recognition');
if (config.url) return { url: config.url, model: config.model ?? '' };
// Fallback to legacy settings.json
const settings = await Bun.file(settingsPath).json().catch(() => ({}));
return settings.ocr as OcrConfig | undefined;
}