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

Display Subtitles/CC and 4k tag - #917 #5119

Merged
merged 22 commits into from
May 30, 2024

Conversation

dkshxd
Copy link
Contributor

@dkshxd dkshxd commented May 17, 2024

Title

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Closes #917

Description

Implementation of the "4K" and "Subtitles" labels on video search results. See screenshots.
Note: I've only seen this on the search screen so they haven't been implemented anywhere else.

Screenshots

4k-and-subtitles
No-labels

Testing

See screenshots for testing

  1. Search of 4k and subtitles. Results show 4K and subtitles together
  2. Search results including just 4K or subtitles separately
  3. Search results including no 4K and subtitle labels
  4. Rudimentary check of subscriptions, trending, most popular, history screens. Labels don't appear there. I don't see them on the Youtube website either.

Desktop

  • Windows
  • 10
  • v0.20.0 Beta

Additional context

The implementation is flexible enough to support the addition of more labels such as "Live". I'll leave that for another ticket. Live shouldn't be that difficult, however someone will probably need to implement the icon. The alternative is a red label saying "Live" perhaps with a big text dot in front of it.

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label May 17, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 17, 2024 00:40
auto-merge was automatically disabled May 17, 2024 01:48

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 17, 2024 01:48
@jasonhenriquez
Copy link
Collaborator

Thanks for putting in the initiative on this @dkshxd! Left some suggested changes and questions.

@efb4f5ff-1298-471a-8973-3d47447115dc

There is also a 8k and a new label. Could you implement those also.

auto-merge was automatically disabled May 20, 2024 00:23

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 20, 2024 00:23
auto-merge was automatically disabled May 20, 2024 10:23

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 20, 2024 10:23
@absidue
Copy link
Member

absidue commented May 20, 2024

The implementation is flexible enough to support the addition of more labels such as "Live". I'll leave that for another ticket. Live shouldn't be that difficult, however someone will probably need to implement the icon. The alternative is a red label saying "Live" perhaps with a big text dot in front of it.

FreeTube already labels live videos, so unless I am missing something, I doubt we'll need a second label to convey the same information. That being said, a quick look at the linked issue tells me that that paragraph was added due to a missunderstanding of an unrelated comment on that issue about support for live captions (they likely mean either Windows 11's live captions feature where the operating system displays auto-generated captions in a separate window on top of the programs window, so nothing we would have any control over or Google Chrome's closed source proprietary live captions feature, which we would have no way of implementing considering it's closed source and proprietary nature).

live-stream

auto-merge was automatically disabled May 20, 2024 23:22

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 20, 2024 23:22
auto-merge was automatically disabled May 20, 2024 23:27

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 20, 2024 23:27
auto-merge was automatically disabled May 20, 2024 23:57

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 20, 2024 23:57
@dkshxd
Copy link
Contributor Author

dkshxd commented May 22, 2024

Agree with the "Live" label comment, it's already on the video thumbnail, so a duplication won't need to be implemented.

"8k" and "new", I don't see them being supported on the Youtube API we're using. I can see 8k on the JSON response but I suspect someone will have to implement it on the API, unless someone can point it out to me.

@absidue
Copy link
Member

absidue commented May 22, 2024

I don't see them being supported on the Youtube API we're using.

Do you mean the local API (so YouTube.js) or the Invidious API, because FreeTube supports both?

@dkshxd
Copy link
Contributor Author

dkshxd commented May 23, 2024

I don't see them being supported on the Youtube API we're using.

Do you mean the local API (so YouTube.js) or the Invidious API, because FreeTube supports both?

Do you mean the local API (so YouTube.js) or the Invidious API, because FreeTube supports both?

I'm looking at the local API using Youtubei.js. The movie and video objects don't seem have methods/attributes for 8k and new. It's there for live and 4k.

@PikachuEXE
Copy link
Collaborator

I hope next time the branch name can be non development, can't checkout branch with gh pr checkout 5119

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Member

What error are you receiving?

@PikachuEXE
Copy link
Collaborator

Can only be checkout if latest dev merged into target branch, but no point making this happen since making a new branch to make changes (especially for opening PR) is a common practice already.
image

Comment on lines +831 to +833
premiereDate: video.upcoming,
is4k: video.is_4k,
hasCaptions: video.has_captions
Copy link
Collaborator

Choose a reason for hiding this comment

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

(Not line specific or even PR specific)
This is why I dislike missing trailing commas in general - the extra diff and more difficult to duplicate lines
Just a rant not request to change
image

Comment on lines +17 to +24
padding: 3px;
margin-inline: 2px;
background-color: var(--secondary-card-bg-color);
font-size: 10px;
border-radius: 2px;
display: inline-block;
font-weight: 500;
white-space-collapse: collapse;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again not request to change but suggestion for future changes
IMO the rules are easier to read when grouped (and sorted is even better) like (comment is optional)

.videoTag {
  /* Spacing/outward stuff */
  margin-inline: 2px;
  padding: 3px;

  /* Self */
  display: inline-block;
  background-color: var(--secondary-card-bg-color); /* Normally I group this with color but it's absent here */

  /* Content like text */
  font-size: 10px;
  font-weight: 500;
  white-space-collapse: collapse;

@FreeTubeBot FreeTubeBot merged commit f3ac478 into FreeTubeApp:development May 30, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label May 30, 2024
@absidue
Copy link
Member

absidue commented May 30, 2024

I hope next time the branch name can be non development, can't checkout branch with gh pr checkout 5119

@PikachuEXE You can add --branch a-different-name to the command to make it name the local branch differently.

https://cli.github.com/manual/gh_pr_checkout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display Subtitles/CC and 4k tag
7 participants