minor fixes

This commit is contained in:
mertalev 2025-10-15 14:57:53 -04:00
parent c285caf8bd
commit ec566339ad
No known key found for this signature in database
GPG key ID: DF6ABC77AAD98C95
5 changed files with 9 additions and 9 deletions

View file

@ -113,6 +113,7 @@ describe('/server', () => {
importFaces: false,
oauth: false,
oauthAutoLaunch: false,
ocr: true,
passwordLogin: true,
search: true,
sidecar: true,

View file

@ -253,9 +253,9 @@
"oauth_storage_quota_claim_description": "Automatically set the user's storage quota to the value of this claim.",
"oauth_storage_quota_default": "Default storage quota (GiB)",
"oauth_storage_quota_default_description": "Quota in GiB to be used when no claim is provided.",
"ocr_job_description": "Use machine learning to recognize text in images",
"oauth_timeout": "Request Timeout",
"oauth_timeout_description": "Timeout for requests in milliseconds",
"ocr_job_description": "Use machine learning to recognize text in images",
"password_enable_description": "Login with email and password",
"password_settings": "Password Login",
"password_settings_description": "Manage password login settings",

View file

@ -12,8 +12,5 @@ export async function up(db: Kysely<any>): Promise<void> {
}
export async function down(db: Kysely<any>): Promise<void> {
await sql`DROP INDEX "asset_ocr_assetId_idx";`.execute(db);
await sql`ALTER TABLE "asset_ocr" DROP CONSTRAINT "asset_ocr_pkey";`.execute(db);
await sql`ALTER TABLE "asset_ocr" DROP CONSTRAINT "asset_ocr_assetId_fkey";`.execute(db);
await sql`DROP TABLE "asset_ocr";`.execute(db);
}

View file

@ -9,10 +9,12 @@ export async function up(db: Kysely<any>): Promise<void> {
await sql`CREATE INDEX "idx_ocr_search_text" ON "ocr_search" USING gin (f_unaccent("text") gin_trgm_ops);`.execute(
db,
);
await sql`INSERT INTO "migration_overrides" ("name", "value") VALUES ('index_idx_ocr_search_text', '{"type":"index","name":"idx_ocr_search_text","sql":"CREATE INDEX \\"idx_ocr_search_text\\" ON \\"ocr_search\\" USING gin (f_unaccent(\\"text\\") gin_trgm_ops);"}'::jsonb);`.execute(
db,
);
}
export async function down(db: Kysely<any>): Promise<void> {
await sql`ALTER TABLE "ocr_search" DROP CONSTRAINT "ocr_search_pkey";`.execute(db);
await sql`ALTER TABLE "ocr_search" DROP CONSTRAINT "ocr_search_assetId_fkey";`.execute(db);
await sql`DROP TABLE "ocr_search";`.execute(db);
await sql`DELETE FROM "migration_overrides" WHERE "name" = 'index_idx_ocr_search_text';`.execute(db);
}

View file

@ -6,7 +6,7 @@
export type SearchFilter = {
query: string;
ocr: string;
ocr?: string;
queryType: 'smart' | 'metadata' | 'description' | 'ocr';
personIds: SvelteSet<string>;
tagIds: SvelteSet<string> | null;
@ -75,7 +75,7 @@
let filter: SearchFilter = $state({
query,
ocr: 'ocr' in searchQuery ? searchQuery.ocr : '',
ocr: searchQuery.ocr,
queryType: defaultQueryType(),
personIds: new SvelteSet('personIds' in searchQuery ? searchQuery.personIds : []),
tagIds:
@ -114,7 +114,7 @@
const resetForm = () => {
filter = {
query: '',
ocr: '',
ocr: undefined,
queryType: defaultQueryType(), // retain from localStorage or default
personIds: new SvelteSet(),
tagIds: new SvelteSet(),