fix(tecdoc): only surface publicly-resolvable part images

The snapshot stores scrape-local '/_debug/...' image paths that 404
off-host. Filter the OEM lookup to http(s) image URLs and render the
thumbnail only when one exists, so the detail page shows clean
code-focused cards instead of a grid of broken-image placeholders.
Real CDN URLs will surface automatically once present.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-09 21:00:12 +03:00
parent eae373c553
commit 24e44a49f8
2 changed files with 9 additions and 2 deletions

View File

@@ -128,8 +128,13 @@ export class TecdocSourceDbService implements OnModuleInit, OnModuleDestroy {
COALESCE((
SELECT json_agg(json_build_object('url', i.image_url, 'thumb', i.thumb_url) ORDER BY i.sort_order)
FROM (
-- Only publicly-resolvable URLs. The current snapshot stores
-- scrape-local '/_debug/...' paths (404 off-host) — filtering them
-- here keeps the API contract honest so the UI shows no broken
-- thumbnails; real CDN URLs surface automatically once present.
SELECT image_url, thumb_url, sort_order FROM article_images
WHERE article_id = a.id ORDER BY sort_order LIMIT 8
WHERE article_id = a.id AND image_url LIKE 'http%'
ORDER BY sort_order LIMIT 8
) i
), '[]') AS images,
COALESCE((