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 option to filter shorts #11650

Closed
wants to merge 7 commits into from
Closed

Conversation

DehaanSolo
Copy link

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • add filter option to hide shorts
  • added filter in FeedLoadManager (open to discussion about effectiveness)

The changes I have made so far don't seem to be entirely effective - I suspect some details aren't being extracted properly, as some short form content still gets through the filter.

Before/After Screenshots/Screen Record

Before:
image

After:
image

I haven't shown a before / after for the effects of the filter, as it does not currently seem to work. A breakpoint on the filter I applied does get hit when loadStreams is called in FeedLoadManager - Part of the reason I wanted to open this PR is to get feedback, and to try and understand the functional flow of the program. I suspect part of the reason it isn't properly filtering, is values not being extracted properly. For example, the filter checks if the stream is short form content, however short form content is still displayed in the feed.

No changes were made to the extractor for this solution.

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@github-actions github-actions bot added the size/small PRs with less than 50 changed lines label Oct 27, 2024
@ShareASmile ShareASmile added feature request Issue is related to a feature in the app youtube Service, https://www.youtube.com/ GUI Issue is related to the graphical user interface labels Oct 27, 2024
Copy link
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

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

Hi, thank you for opening the PR.

isSHortFOrmContent() should be extracted correctly in slow / normal mode. THat is done in YoutubeStreamInfoItemExtractor.
YouTubeFeedIinfoItemExtractor is responsible for extracting isShortFormContent() from the feed info when fast mode is enabled. However, the XML Atom Feed does not provide such info, it does not even provide the video's duration.

@TobiGr
Copy link
Contributor

TobiGr commented Oct 27, 2024

Please let me know if you are an ANU student for internal statistics and because I am writing my master thesis about open source contributions as part of learning computer science and computer science education at university.

@DehaanSolo
Copy link
Author

Thanks @TobiGr - I must've missed that one. And yes, I am a student at ANU. You might've noticed a few contributions from students recently, we are required to for an assignment :) . Thanks also for the information about how the extractors work, it is a lot to get my head around in such a short period of time.

@TobiGr TobiGr self-assigned this Oct 27, 2024
Copy link

@TobiGr
Copy link
Contributor

TobiGr commented Oct 27, 2024

Hey, I just took a deeper dive into this PR and think that the main problem here is bad UX (again). We already have an option to filter the feed content. It can be found in the settings: settings > content > feed: fetch channel tabs. I suggest to rename the title of the setting to something like "Feed content" which is less technical. We are currently working on rewriting large chunks of NewPipe for better UI/UX and code quality. Having multiple places to adjust the feed is not good. We might want to unify this somehow (no need to do this in this PR).

The filter itself is implemented here in FeedLoadManager and prevents the unwanted items to be fetched from the internet. However, they might have been fetched already if the user opened the shorts tab manually in the channel details. fetchFeedChannelTab() should be renamed to something more descriptive like shouldFetchFeedChannelTab() to make it clear that the method does not fetch any items. A proper JDoc would be useful, too.

So in summary, I think we do not need the option you introduced because there is one already. But your functionality might be needed to filter items actually displayed in the feed. I just took a quick look and we might even need filters for the other content options as well. But I'd like to have some feedback from other maintainers on this whole issue first.

@Stypox
Copy link
Member

Stypox commented Nov 12, 2024

I think this can be solved by just adding some text in the "Show the following streams" dialog, with a button to bring the user to the "Fetch channel tabs" setting.

@Stypox
Copy link
Member

Stypox commented Nov 18, 2024

Closing as there has not been an answer yet and the current code is not ideal. As noted in my previous comment, I would support adding an informative text to the "Show the following streams" dialog instead. Also, now NewPipe is going through a refactor and is not accepting PRs for new features, as noted in the README.

@Stypox Stypox closed this Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app GUI Issue is related to the graphical user interface size/small PRs with less than 50 changed lines youtube Service, https://www.youtube.com/
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Option to remove Shorts from the Trending Page
4 participants