From 8cfa971078cbb03fc8d35bbd10010fcfdca27166 Mon Sep 17 00:00:00 2001 From: DJP Date: Fri, 17 Oct 2025 15:52:44 -0400 Subject: [PATCH] Add debug for asset_content_info structure and try all renditions --- workflow_v3.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/workflow_v3.php b/workflow_v3.php index 774de7d..f488d63 100644 --- a/workflow_v3.php +++ b/workflow_v3.php @@ -386,11 +386,15 @@ function downloadAsset($testRunner, $assetId, $filename, $campaignId, $assetData $alternativeRenditions = []; if ($assetData && isset($assetData['asset_content_info'])) { - foreach ($assetData['asset_content_info'] as $contentInfo) { - if (is_array($contentInfo) && isset($contentInfo['url']) && isset($contentInfo['rendition_type'])) { - $rendType = $contentInfo['rendition_type']; - // Try preview, thumbnail, or any other available rendition - if (in_array($rendType, ['preview_content', 'thumbnail_content', 'PREVIEW', 'THUMBNAIL'])) { + $debugInfo['asset_content_info_count'] = count($assetData['asset_content_info']); + + foreach ($assetData['asset_content_info'] as $key => $contentInfo) { + if (is_array($contentInfo)) { + $rendType = $contentInfo['rendition_type'] ?? $key; + $debugInfo['content_info_keys'][] = $key; + + if (isset($contentInfo['url'])) { + // Add ALL renditions, not just preview/thumbnail $alternativeRenditions[] = [ 'url' => str_replace('/otmmapi/', '/', $contentInfo['url']), 'type' => $rendType @@ -398,6 +402,8 @@ function downloadAsset($testRunner, $assetId, $filename, $campaignId, $assetData } } } + + $debugInfo['alternative_renditions_found'] = count($alternativeRenditions); } // Try alternative renditions