Resolves the cover image for a `ProductReleaseCard` using a deterministic priority chain, serving as the single source of truth for all surfaces that render release covers. ## Key Components ### `ReleaseCoverSource` Input interface describing the available image candidates on a release entity: | Field | Description | |---|---| | `featured_image` | Editor-curated cover — highest priority | | `highlight_video_thumbnail` | AI-generated highlight reel thumbnail | | `main_video_thumbnail` | Full-release video thumbnail | | `og_image_url` | SEO/OG fallback image | ### `ReleaseCoverResult` Output interface returned by the resolver: | Field | Description | |---|---| | `cover` | Resolved image URL, or `null` if none available | | `hasVideoCover` | `true` only when the active cover is a video thumbnail (priorities 2–3) | ### `resolveReleaseCover(r: ReleaseCoverSource): ReleaseCoverResult` Applies the priority chain using `||` (not `??`) so empty strings fall through rather than rendering a broken ``. `hasVideoCover` is suppressed when `featured_image` is set, preventing a misleading Play overlay on still images. ## Usage Example ```typescript import { resolveReleaseCover } from './release-cover' const { cover, hasVideoCover } = resolveReleaseCover({ featured_image: null, highlight_video_thumbnail: 'https://cdn.example.com/highlight.jpg', main_video_thumbnail: 'https://cdn.example.com/main.jpg', og_image_url: 'https://cdn.example.com/og.jpg', }) // cover → 'https://cdn.example.com/highlight.jpg' // hasVideoCover → true ``` > **Adding a new fallback source?** Edit only `ReleaseCoverSource`, `ReleaseCoverResult`, and the chain in `resolveReleaseCover` — all rendering surfaces pick up the change automatically. **Source:** [`release-cover.ts`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/release-cover.ts)