assets without objects

This commit is contained in:
2025-11-20 02:32:11 +01:00
parent 0eb4c0a294
commit 78e6d3e431
6 changed files with 59 additions and 139 deletions
+3 -6
View File
@@ -6,8 +6,6 @@ import type {
GetAsset as AssetManagerGetAsset,
} from '../asset_manager';
const BASE_FETCH_OPTIONS = { start: 1, limit: 1 } as const;
interface DocumentVersion extends DocumentVersionLike {
download_path?: string | null;
}
@@ -22,7 +20,7 @@ export type EnsurePreviewData = (id: string | number) => Promise<DocumentLike |
export type EnsureAssetUrl = (
id: string | number,
asset: AssetLike,
options?: { start?: number; limit?: number; force?: boolean },
options?: { force?: boolean },
) => Promise<AssetLike | null>;
export type GetDocumentAsset = AssetManagerGetAsset;
@@ -70,7 +68,7 @@ export async function resolveOcrTextUrl({
let entry: AssetLike = asset;
if (ensureAssetUrl) {
const ensureOptions = { ...BASE_FETCH_OPTIONS, force: !hasUrl };
const ensureOptions = { force: !hasUrl };
const ensured = await ensureAssetUrl(docRef.id!, asset, ensureOptions);
if (ensured) {
entry = ensured;
@@ -87,8 +85,7 @@ export async function resolveOcrTextUrl({
resolveDocumentAssetUrl(docRef, 'ocr-text', {
ensureAssetUrl,
getAsset: getDocumentAsset,
ensureOptions: { ...BASE_FETCH_OPTIONS, force: true },
objectOrdinal: 1,
ensureOptions: { force: true },
}) || null
);
}