Conversation
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
domlander
reviewed
Feb 3, 2026
domlander
approved these changes
Feb 3, 2026
Contributor
domlander
left a comment
There was a problem hiding this comment.
Looks great. I think this is a really useful PR.
- Should we use either
isLiveorisLiveStreamin both places or do you think there's enough semantic difference between the words to make them suitable forCard.tsxandYoutubeBlockComponent.importable.tsxrespectively?
Contributor
Author
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. |
|
Seen on PROD (merged by @abeddow91 8 minutes and 32 seconds ago) Please check your changes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.