mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-03 10:45:52 +00:00
refactor: use assetCacheManager for OCR data (#25437)
This commit is contained in:
parent
a96a08939e
commit
84679fb2b2
2 changed files with 4 additions and 2 deletions
|
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue