-
Notifications
You must be signed in to change notification settings - Fork 798
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
Podcast Player: Increase podcast shown #21661
Podcast Player: Increase podcast shown #21661
Conversation
This commit is a part of issue Automattic#21291. This commit is pushed in a separate branch to avoid confusion from the previous suggested solution. In this PR changes are: * Introduced a new endpoint `track-quantity` to return number of tracks. * Added a new method in the front end codebase to call the above mentioned API. * After calling update `defaultMaxItems` of the rangeControlUI
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Jetpack plugin:
|
projects/plugins/jetpack/_inc/lib/class-jetpack-podcast-helper.php
Outdated
Show resolved
Hide resolved
In this commit, we're deprecating `jetpack_podcast_helper_list_quantity` filter and introducing a new filter `jetpack_podcast_helper_tracks_quantity`. New filter will work without $rss.
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.
Looking good and is working to do what we want 👍 Left some suggestions and a comment in hopes of polishing things up a bit.
projects/plugins/jetpack/_inc/lib/class-jetpack-podcast-helper.php
Outdated
Show resolved
Hide resolved
projects/plugins/jetpack/_inc/lib/class-jetpack-podcast-helper.php
Outdated
Show resolved
Hide resolved
...etpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-podcast-player.php
Outdated
Show resolved
Hide resolved
projects/plugins/jetpack/extensions/blocks/podcast-player/api.js
Outdated
Show resolved
Hide resolved
projects/plugins/jetpack/extensions/blocks/podcast-player/edit.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Samiff <samiff@users.noreply.github.com>
Co-authored-by: Samiff <samiff@users.noreply.github.com>
Co-authored-by: Samiff <samiff@users.noreply.github.com>
Co-authored-by: Samiff <samiff@users.noreply.github.com>
In this commit, I have removed url parameter from fetchTrackQuantity api method and I have written a separate hook to call the same function.
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.
Thanks for adding those changes, this is looking good! I added two minor suggestions, and please merge the master branch once more into your branch so the checks are able to pass.
I was checking the docs about add_filter but couldn't find what is the best practice to write add_filter I mean whether we should write it in the class __construct or any class method and so on.
Hmm not sure I fully understood the question being asked here so feel free to clarify if I missed something. As an end user, I would be able to do something like
function my_jetpack_podcast_helper_tracks_quantity( $tracks_quantity ) {
return 42;
}
add_filter( 'jetpack_podcast_helper_tracks_quantity', 'my_jetpack_podcast_helper_tracks_quantity' );
My personal preference would be to add that to a mu-plugin
file, or perhaps a child theme's functions.php file. Adding that example snippet seems to work well:
projects/plugins/jetpack/extensions/blocks/podcast-player/edit.js
Outdated
Show resolved
Hide resolved
projects/plugins/jetpack/extensions/blocks/podcast-player/api.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Samiff <samiff@users.noreply.github.com>
Co-authored-by: Samiff <samiff@users.noreply.github.com>
PR is up to date 🎉 Oh God! I was writing Thanks once again Samiff & jeherve. Really appreciate your efforts and patience ❤️ Hopefully, I will keep this in mind that there is |
Thanks for the contribution @amustaque97 these changes are now merged and will be shipped as part of Jetpack version 10.4 on 2021-12-07 🎉 |
Internal: r235233-wpcom , D70255-code |
* master: (28 commits) Prepare for 10.4-a.7 (#21797) Check if maxwidth exists before trying to call .length (#21785) Podcast Player: Increase podcast shown (#21661) licensing: jetpack-js-test-runner is a dev dependency (#21794) Update dependency @mdn/browser-compat-data to v4.0.11 (#21792) Tests: Fix unit tests for wpcom (#21649) SSO: Fix Button Text Alignment on Mobile (#18770) Add/my jetpack skeleton (#21464) Identity Crisis: add unit tests for has_identity_crisis and get_mismatched_urls (#21754) Remove special cases for calling changelogger on packages/changelogger (#21783) eslint-config-target-es: Release 1.0.0! (#21766) Revert "WPCOM no longer forces home_urls to be http" (#21769) WPCOM no longer forces home_urls to be http (#21747) Revert and fix "Revert "Assets: do not use the new method yet (#21760)"" (#21763) eslint-config-target-es: Fix README.md (#21743) codesniffer: Disable CI on PHP 8.1 (#21742) RNA Pricing card component: Fix case where prices before and after match (#21757) Janitorial: update Jetpack version for 10.4-a.6 cycle (#21762) Releases: prepare changelog for 10.4-a.5 release (#21758) Assets: do not use the new method yet (#21760) ...
* master: (28 commits) Prepare for 10.4-a.7 (#21797) Check if maxwidth exists before trying to call .length (#21785) Podcast Player: Increase podcast shown (#21661) licensing: jetpack-js-test-runner is a dev dependency (#21794) Update dependency @mdn/browser-compat-data to v4.0.11 (#21792) Tests: Fix unit tests for wpcom (#21649) SSO: Fix Button Text Alignment on Mobile (#18770) Add/my jetpack skeleton (#21464) Identity Crisis: add unit tests for has_identity_crisis and get_mismatched_urls (#21754) Remove special cases for calling changelogger on packages/changelogger (#21783) eslint-config-target-es: Release 1.0.0! (#21766) Revert "WPCOM no longer forces home_urls to be http" (#21769) WPCOM no longer forces home_urls to be http (#21747) Revert and fix "Revert "Assets: do not use the new method yet (#21760)"" (#21763) eslint-config-target-es: Fix README.md (#21743) codesniffer: Disable CI on PHP 8.1 (#21742) RNA Pricing card component: Fix case where prices before and after match (#21757) Janitorial: update Jetpack version for 10.4-a.6 cycle (#21762) Releases: prepare changelog for 10.4-a.5 release (#21758) Assets: do not use the new method yet (#21760) ...
Edit: I posted this request in the original issue here: |
Support References This comment is automatically generated. Please do not edit it.
|
Fixes #21291
Changes proposed in this Pull Request:
Jetpack product discussion NO
Does this pull request change what data or activity we track or use? NO
Testing instructions:
podcast player
blockfunctions.php
filenumber of items
button in podcast settings UI.return 15;
of filter to some different value and it will update max limit in the rangeControlUI as well.Screenshots
cc @samiff , I have created a separate branch because there are a lot of changes in the previous branch.