Skip to content

Video atom livestream#15288

Merged
abeddow91 merged 7 commits intomainfrom
ab/islive-video-atom
Feb 5, 2026
Merged

Video atom livestream#15288
abeddow91 merged 7 commits intomainfrom
ab/islive-video-atom

Conversation

@abeddow91
Copy link
Contributor

@abeddow91 abeddow91 commented Feb 3, 2026

What does this change?

This PR centralises the logic used to determine whether a YouTube video atom represents a livestream.

It introduces a new isLive property on the YouTube atom model and moves the logic that derives this value into the enhanceCards step. Downstream consumers of the atom can now rely on this single, explicit field instead of re-implementing their own checks.

Why?

DCR currently relies on brittle logic to infer whether a YouTube video is a livestream - specifically by checking whether the video duration is 0. This logic is made even more brittle as any youtube video without a duration is defaulted to 0 during enhancement.

Ideally, this decision should be made further upstream in Media Atom Maker when the atom is uploaded to YouTube. Until that is possible, this PR refactors the existing behaviour to:

  • Centralise the livestream decision in one place
  • Make the intent explicit via an isLive property
  • Reduce duplication and fragility in downstream code

Note: This change does not improve the underlying detection logic itself. The duration based check remains for now, but it is now isolated and easier to replace in the future once a more reliable signal is available.

@abeddow91 abeddow91 self-assigned this Feb 3, 2026
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@abeddow91 abeddow91 added fronts + curation maintenance Departmental tracking: maintenance work, not a fix or a feature run_chromatic Runs chromatic when label is applied labels Feb 3, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Feb 3, 2026
Copy link
Contributor

@domlander domlander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I think this is a really useful PR.

  • Should we use either isLive or isLiveStream in both places or do you think there's enough semantic difference between the words to make them suitable for Card.tsx and YoutubeBlockComponent.importable.tsx respectively?

@abeddow91
Copy link
Contributor Author

Looks great. I think this is a really useful PR.

  • Should we use either isLive or isLiveStream in both places or do you think there's enough semantic difference between the words to make them suitable for Card.tsx and YoutubeBlockComponent.importable.tsx respectively?

Thanks @domlander. Good point - I dont think there is a distinction between the two so I've opted for isLive everywhere 👍 That should make debugging simpler.

@abeddow91 abeddow91 added the run_chromatic Runs chromatic when label is applied label Feb 3, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Feb 3, 2026
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

@abeddow91 abeddow91 merged commit 83d120f into main Feb 5, 2026
31 checks passed
@abeddow91 abeddow91 deleted the ab/islive-video-atom branch February 5, 2026 09:18
@gu-prout
Copy link

gu-prout bot commented Feb 5, 2026

Seen on PROD (merged by @abeddow91 8 minutes and 32 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fronts + curation maintenance Departmental tracking: maintenance work, not a fix or a feature Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants