Compare commits

...

1 Commits

Author SHA1 Message Date
midzelis
d2d6cabf1d refactor: use assetCacheManager for OCR data 2026-01-22 01:00:22 +00:00
2 changed files with 4 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
import { assetCacheManager } from '$lib/managers/AssetCacheManager.svelte';
import { ocrManager, type OcrBoundingBox } from '$lib/stores/ocr.svelte';
import { getAssetOcr } from '@immich/sdk';
import { beforeEach, describe, expect, it, vi } from 'vitest';
@@ -30,6 +31,7 @@ describe('OcrManager', () => {
beforeEach(() => {
// Reset the singleton state before each test
ocrManager.clear();
assetCacheManager.clearOcrCache();
vi.clearAllMocks();
});

View File

@@ -1,5 +1,5 @@
import { assetCacheManager } from '$lib/managers/AssetCacheManager.svelte';
import { CancellableTask } from '$lib/utils/cancellable-task';
import { getAssetOcr } from '@immich/sdk';
export type OcrBoundingBox = {
id: string;
@@ -38,7 +38,7 @@ class OcrManager {
this.#cleared = false;
}
await this.#ocrLoader.execute(async () => {
this.#data = await getAssetOcr({ id });
this.#data = await assetCacheManager.getAssetOcr(id);
}, false);
}