-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Allow starting the search fragment via intent #11615
Conversation
How does this interact with service selection? If Soundcloud is selected by the user before this intent is sent, will it still work? |
I think it will still work. Through ServiceHelper. GetSelectedServiceId (this) in RouterActivity service for the currently selected user ID is the keypoint. This ID is then passed to the MainActivity and used to initialize the SearchFragment, make sure that the search operation is performed for the currently selected service by the user. Therefore, if the user has selected SoundCloud before sending this intent, the search will be performed on SoundCloud. |
I'm a little confused, then. If an app sends to search for a Youtube video, but the user has selected Soundcloud, will they get an incorrect search? Or maybe an error? There seems to be a need to specify the service in addition to the query string. |
I understand the question. I can add a match to the URL with the service parameter in the Intent filter. The new command can be newpipe://search? service=youtube&q=funny cats |
I have improved the code so that now users can specify a service to search by adding a service name to the URL. And an error notification for the wrong name. I also modified the Pull Request description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank your for the PR.
Please clean your git history, squash commits if reasonable, check for faulty merges / rebases. Your PR has merge conflicts. We'll take another look at this PR once the changeset is clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like that a merge / rebase went wrong here. This reverts changes from a recently merged PR. Please check and clean your git history and rebase the PR.
- Implemented the abilImplemented the ability for third-party apps to initiate a search in NewPipe on a specific service by using the custom URL scheme `newpipe://search?service=SERVICE_NAME&q=YOUR_QUERY`. - Added intent-filter to RouterActivity to handle the custom URL scheme. - Enhanced RouterActivity to parse the incoming service parameter, retrieve the corresponding service ID, and start MainActivity with the specified service and search query. - Added error handling for invalid service names: displays an error message to the user if the service name is invalid. - Tested the implementation using ADB commands to send an intent with the custom URI. Fixes: Expose search API with url TeamNewPipe#3475 Add new tag to customize urls add logic of handling custom search intents in onCreate method add comments to helping review add a new method to get the service by name improve the RouterActivity to handle the service name improve the RouterActivity
Closing as there has not been recent activity and because NewPipe is currently not accepting new feature PRs, as noted in the README. This feature, however, would be pretty neat. It should probably be implemented in MainActivity though. |
What is it?
Description of the changes in your PR
newpipe://search?service=SERVICE_NAME\&q=YOUR_QUERY
.adb shell am start -a android.intent.action.VIEW -d "newpipe://search?service=Soundcloud\&q=funny%20cats"
.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