backend: split assets into objects

This commit is contained in:
2025-10-20 16:28:57 +02:00
parent 96a6d0ee5d
commit c44ba91ec7
9 changed files with 163 additions and 105 deletions
+4 -2
View File
@@ -446,8 +446,10 @@ const DetailPanel = ({
return null;
}
const asset = getDocumentAsset(doc, 'preview');
const width = Number(asset?.metadata?.width) || 0;
const height = Number(asset?.metadata?.height) || 0;
const primaryObject = asset?.objects?.[0] || null;
const primaryMetadata = primaryObject?.metadata || asset?.metadata || {};
const width = Number(primaryMetadata?.width) || 0;
const height = Number(primaryMetadata?.height) || 0;
const orientation = width > 0 && height > 0 ? (width >= height ? 'landscape' : 'portrait') : 'landscape';
return {
id: doc.id,