Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: parse isLive in CompactVideo #294

Merged
merged 4 commits into from
Jan 27, 2023

Conversation

ChunkyProgrammer
Copy link
Contributor

Feat: parse isLive in CompactVideo

Description

This looks for a badge to determine if a CompactVideo is live

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

in CompactVideo
@ChunkyProgrammer
Copy link
Contributor Author

Using this video https://youtu.be/jfKfPfyJRdk I find that you can consistently find live and non live videos in the watch_next_feed

Co-authored-by: absidue <[email protected]>
Copy link
Owner

@LuanRT LuanRT left a comment

Choose a reason for hiding this comment

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

Looks good. The only thing I think should be changed here is how the badge renderers are being accessed, they should go through the parser first and only then they should be used.

The Video node is a good example:

this.badges = Parser.parseArray(data.badges, MetadataBadge);

get is_live(): boolean {
return this.badges.some((badge) => {
if (badge.label === 'BADGE_STYLE_TYPE_LIVE_NOW' || badge.style === 'LIVE')
return true;
});
}

@LuanRT LuanRT merged commit 2acb7da into LuanRT:main Jan 27, 2023
@ChunkyProgrammer ChunkyProgrammer deleted the feat/parse-isLive-compactVideo branch January 27, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants