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

Youtube search filters #124

Closed
wants to merge 21 commits into from
Closed

Youtube search filters #124

wants to merge 21 commits into from

Conversation

Bluesir9
Copy link

@Bluesir9 Bluesir9 commented Nov 9, 2018

  • I carefully read the contribution guidelines and agree to them.
  • I did test the API against NewPipe.
  • I agree to ASAP create a PULL request for NewPipe for making in compatible when I changed the api.

- Added new logic to implement sort and search filters for YouTube search filters in YoutubeSearchQueryHandlerFactory.
- Corrected some typos in SearchQueryHandlerFactory.
- Changed test cases affected by changes made to YoutubeSearchQueryHandlerFactory.
- Added todo items for the 2 primary test cases in YoutubeSearchQHTest.
- Added ability to handle more filters.
- Added test cases to appropriately test the new filters implemented in combination with the available sorters.
@theScrabi
Copy link
Member

You can find a description on how to test the changes on the frontend here: https://teamnewpipe.github.io/documentation/04_Run_changes_in_App/

@Bluesir9
Copy link
Author

@theScrabi Have tested the changes on the app and made necessary changes.

@theScrabi
Copy link
Member

All right thx :)

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.

@Bluesir9 I found some time to take a look at your changes. As said before, I am not that familiar with the extractor, but I'll try my best to give you detailed feedback. In case it sounds like nonsense, please tell me. There are so many largre PRs to review atm, so I might have missed something important.

I didn't test the changes yet, but the code looks quite mature.


I have one question about the added filters. You added following filters:

Time: last hour, today, this week, this month, this year

Type/Content: video, channel, playlist, movie, show,

Duration: short, long

Sorting: relevance, rating, upload date, view count

Do you intend to implement the features filter with
live, 4K, HD, Subtitles/CC, Creative Commons, 360°, VR180, 3D, HDR, location?

- Fixed indendation issue in YoutubeSearchQueryHandlerFactory and YoutubeSearchQHTest.
- Added Features filter type and filter.
- Fixed handling for features content filters.
- Added test cases to check for whether feature content filters are working fine.
@Bluesir9
Copy link
Author

Bluesir9 commented Dec 8, 2018

@TobiGr For whatever reason "Feature" filters were not working with the changes I had done last time around, so in the interest of time I removed them last minute. I have implemented them now in the last couple of commits and its working fine. Have also added tests for the same.

- Added license header to Base64 class.
- Added Apache license for AOSP project in a different directory.
@TheAssassin
Copy link
Member

screenshot_2018-12-16_17-30-15

Not sure if you consider this good style, but let me assure you, it's not, it's the worst I've seen in quite a while, actually. The first line of your commit is what is visible from e.g., git log --oneline, etc. Consider it the heading of your commit, it's the title that is supposed to show a reader what has been changed in a commit. Even pretty nonsense comments which are at least different from each other are easier to work with, they can at least

Please see https://chris.beams.io/posts/git-commit/ or https://dev.to/pavlosisaris/git-commits-an-effective-style-guide-2kkn how to write better commit messages.

Also, please try to commit one change at a time, not multiple. Every time you need a bullet point list to describe your changes, you're probably trying to commit too much at once. This principle is also referred to as "atomic commits". See e.g., https://medium.com/@fagnerbrack/one-commit-one-change-3d10b10cebbf, for more information.

@Bluesir9
Copy link
Author

Bluesir9 commented Dec 16, 2018

@TheAssassin Point(s) taken.

Copy link
Member

@theScrabi theScrabi left a comment

Choose a reason for hiding this comment

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

Please also swtich to dev branch.

Movie(FilterType.Content,(byte)0x04),
Show(FilterType.Content,(byte)0x05),

Hour(FilterType.Time,(byte)0x01),
Copy link
Member

Choose a reason for hiding this comment

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

NewPipe can not handle key value pair filter yet :/

Copy link
Author

Choose a reason for hiding this comment

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

I am not sure what you mean but this works out if the box. Albeit it looks kinda bad:

Screenshot_1553365615

Copy link
Member

Choose a reason for hiding this comment

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

Yes this is the issue i ment, it is not possible to add or remove filters like key values. This messes up the UI as you see. The UI should be made ready to handle these filters.

Copy link
Author

Choose a reason for hiding this comment

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

Maybe we could implement the filters at 2 levels? We would initially ask the user to select a FilterType and after they have chosen that, we can ask them the exact filter they wish to apply falling under that FilterType?

So, clicking on the menu icon the first time, will load a list containing Content, Time, Duration, Feature. If the user chooses Duration, then we will show a second list containing Short, Long. And when the user chooses one of those options, then the search is triggered. Does that make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's finish this PR. 🎉 Thanks for being patient!

I am working on a proper design for the filters. This might take until next Sunday, because the new semesters is about to start and thus there are a bunch of other things to do. But I would not recommend to have endless lists. They come with bad UI/UX, because it is hard to get all the (important) information.

FYI:

Copy link
Author

Choose a reason for hiding this comment

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

@TobiGr Of course, take your time. I was just surprised and happy that it worked functionally out of the box.

Copy link
Contributor

Choose a reason for hiding this comment

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

I put my UI ideas into this issue in the app repo. I guess a UI discussion fits better into the other repo.

third-party-licenses/AOSP-APACHE-LICENSE-V2.0 Outdated Show resolved Hide resolved
@Bluesir9 Bluesir9 changed the base branch from master to dev March 23, 2019 14:50
@Bluesir9
Copy link
Author

While testing I found that the app is throwing an error in case of some filters(4K only for now). I will look into this and potentially push fixes for the same by tomorrow.

…se correct titles instead of name when matching elements.
@wb9688
Copy link
Contributor

wb9688 commented Apr 19, 2020

Closing as it's based on YouTube's old site, introduces a new dependency which isn't neccessary, and there being no proper UI for it in NewPipe. Feel free to open a new PR in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request youtube service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants