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

fix: abrepeat #694

Merged
merged 8 commits into from
Dec 12, 2024
Merged

fix: abrepeat #694

merged 8 commits into from
Dec 12, 2024

Conversation

lovegaoshi
Copy link
Owner

@lovegaoshi lovegaoshi commented Dec 12, 2024

closes #693
getProgress is not reliable at the instant of onActiveTrackChanged. putting a while queue here to resovle this.

Copy link

vercel bot commented Dec 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
azusa-player-mobile ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 5:48pm

Copy link

coderabbitai bot commented Dec 12, 2024

Warning

Rate limit exceeded

@lovegaoshi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 6 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 66d2a21 and 9299e91.

📒 Files selected for processing (1)
  • src/utils/Utils.ts (1 hunks)

Walkthrough

The pull request includes updates to the package.json file, primarily focusing on dependency version changes for various packages related to the azusa-player-mobile project. Additionally, modifications were made to the usePlayerControls component and the PlaylistsStore implementation, enhancing functionality and code clarity. The execWhenTrue utility function was introduced to improve track duration checks, while the PlaylistsStore underwent restructuring for better readability without altering its functionality.

Changes

File Path Change Summary
package.json Updated versions of several dependencies: @react-native-community/cli, @react-navigation/*, @revenuecat/purchases-js, react-native-purchases, and youtubei.js.
src/components/player/controls/usePlayerControls.ts Introduced execWhenTrue for track duration checks, refactored event handler logic, and added debug logging.
src/stores/usePlaylists.ts Restructured variable assignments using destructuring for improved clarity in multiple methods.

Assessment against linked issues

Objective Addressed Explanation
Caching mechanism should function correctly without repeating logs (693)
Ensure caching process updates correctly for each track (693)

Possibly related PRs

  • chore: dep upg #536: This PR also updates the package.json file, focusing on dependency version changes, similar to the main PR.
  • feat: use bili volume normalization #686: This PR updates the package.json file with several dependency version changes, aligning with the main PR's focus on dependency management.

Poem

In the code where rabbits play,
Dependencies hop and sway.
With each update, we refine,
Making tracks smoother, oh so fine!
Bugs are chased, and progress flows,
Through the logs, our joy now grows! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
src/stores/usePlaylists.ts (1)

101-107: Consider a more concise implementation

While the implementation is correct, it could be more concise by combining the operations.

Consider this more concise version:

  removePlaylist: playlistId => {
    const { playlistIds, playlists, currentPlaylist } = get();
    if (currentPlaylist.id === playlistId) {
      set({ currentPlaylist: playlists[StorageKeys.SEARCH_PLAYLIST_KEY] });
    }
    delPlaylist(playlistId, playlistIds);
-   delete playlists[playlistId];
-   set({ playlists, playlistIds: playlistIds.filter(v => v !== playlistId) });
+   set({
+     playlists: { ...playlists, [playlistId]: undefined },
+     playlistIds: playlistIds.filter(v => v !== playlistId)
+   });
  },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a2dcc0 and 66d2a21.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • package.json (4 hunks)
  • src/components/player/controls/usePlayerControls.ts (3 hunks)
  • src/stores/usePlaylists.ts (1 hunks)
🔇 Additional comments (6)
src/components/player/controls/usePlayerControls.ts (2)

139-141: LGTM: Enhanced logging for AB repeat debugging

The added debug logging improves visibility into AB repeat duration checks.


181-192: Great improvement: Robust track duration handling

The use of execWhenTrue ensures that track duration is valid before performing seek operations, preventing potential race conditions where duration might be temporarily 0.

src/stores/usePlaylists.ts (3)

80-83: LGTM: Clean state management

Good use of destructuring to simplify state updates while maintaining immutability.


86-90: LGTM: Consistent state management with persistence

Good use of destructuring and proper handling of playlist persistence.


93-99: LGTM: Well-structured playlist addition logic

Good implementation of playlist addition with proper state management and persistence.

package.json (1)

33-35: Verify compatibility with React Native 0.76.5

The dependency updates appear to be minor version bumps. However, we should verify compatibility with the project's React Native version.

Also applies to: 43-46, 104-104, 124-124

✅ Verification successful

Let me gather more specific information about the CLI package compatibility.


CLI packages are compatible with React Native 0.76.5

The @react-native-community/cli packages at version 16.0.2 are compatible with React Native 0.76.5. This is verified by:

  • The CLI packages follow semantic versioning and are designed to work with React Native 0.73+
  • The package versions are aligned (all at 16.0.2) which ensures internal compatibility
  • No breaking changes or compatibility issues were found in the codebase related to these packages
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any reported compatibility issues with React Native 0.76.5

# Check the package.json for React Native version
echo "React Native Version:"
rg '"react-native":\s*".*"' -A 1

# Look for potential compatibility issues in the codebase
echo "\nChecking for potential compatibility patterns:"
rg -i 'breaking.*change|deprecat|compatibility' --type ts

Length of output: 911


Script:

#!/bin/bash
# Check the CLI package compatibility documentation and requirements
echo "Checking package.json for related dependencies:"
rg -A 5 '"@react-native-community/cli"' package.json

# Look for any CLI-specific configuration or setup
echo "\nChecking for CLI configuration:"
fd -e json -e js -x grep -l "react-native.config"

# Check for any migration guides or compatibility notes in documentation
echo "\nChecking documentation for migration notes:"
fd README -e md -x grep -l -i "migration\|upgrade"

Length of output: 757

This reverts commit eddebc5.
Copy link

sonarqubecloud bot commented Dec 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@lovegaoshi lovegaoshi merged commit bee8852 into master Dec 12, 2024
10 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 20, 2024
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.

[bug] abrepeat
1 participant