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

Add video duration filter for recommended videos #2710

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ImBIOS
Copy link

@ImBIOS ImBIOS commented Dec 4, 2024

Fixes #2653

Add a feature to filter recommended videos by duration.

  • Add a new function filterRecommendedVideosByDuration in js&css/extension/www.youtube.com/general/general.js to filter recommended videos by duration.
  • Call filterRecommendedVideosByDuration in the youtubeHomePage function in js&css/extension/www.youtube.com/general/general.js.
  • Add a new setting recommended_videos_min_duration in menu/skeleton-parts/player.js to specify the minimum video duration for recommendations.
  • Add logic to store the user's preferred minimum video duration for recommendations in menu/index.js.
  • Apply the duration filter to related videos in the relatedVideos function in js&css/extension/www.youtube.com/appearance/sidebar/sidebar.js.

Fixes code-charity#2653

Add a feature to filter recommended videos by duration.

* Add a new function `filterRecommendedVideosByDuration` in `js&css/extension/www.youtube.com/general/general.js` to filter recommended videos by duration.
* Call `filterRecommendedVideosByDuration` in the `youtubeHomePage` function in `js&css/extension/www.youtube.com/general/general.js`.
* Add a new setting `recommended_videos_min_duration` in `menu/skeleton-parts/player.js` to specify the minimum video duration for recommendations.
* Add logic to store the user's preferred minimum video duration for recommendations in `menu/index.js`.
* Apply the duration filter to related videos in the `relatedVideos` function in `js&css/extension/www.youtube.com/appearance/sidebar/sidebar.js`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/code-charity/youtube/issues/2653?shareId=XXXX-XXXX-XXXX-XXXX).
@ImprovedTube ImprovedTube marked this pull request as draft December 4, 2024 14:47
@ImprovedTube ImprovedTube marked this pull request as draft December 4, 2024 14:47
@ImprovedTube
Copy link
Member

Awesome!!

Since we have many features, at the start of each, we check if it is enabled

https://github.com/code-charity/youtube/wiki/Contributing#adding-a-feature

#2674

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.

Filter by lengths of videos on recommended page
2 participants