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 "Adding a playlist via 'QueuedLavalinkPlayerExtensions' does not work" #188

Merged
merged 2 commits into from
Oct 13, 2024

Conversation

NycroV
Copy link
Collaborator

@NycroV NycroV commented Sep 23, 2024

Fixes #185

Removes the compound null replacement assignment in favor of regular assigning. The default result value will always be null anyways, so we don't need it.

Adds documentation, and specifies that in the event a playlist is passed to this method, the result returned will be the index of the last track added to the queue, not the first. This is more useful for things like determining queue length with less asynchronous executions in certain contexts, and generally is more useful to end users. When shuffling tracks that are added to the queue, this return result is irrelevant anyways.

Ex: if a player is currently playing, but has an empty track queue, and a playlist with 5 tracks is played, track index 5 should be returned.

It may be worth adding support for determining whether you want the first or last index returned in the future, but it could also potentially be seen as clogging the API with unnecessary methods. Will have to see as time goes on.

@NycroV NycroV linked an issue Sep 23, 2024 that may be closed by this pull request
Copy link

Delta Summary

Generated on: 09/23/2024 - 04:02
Description Previous Current Delta
Coverage date: 09/12/2024 - 18:05 09/23/2024 - 04:02
Line coverage: 64.5% 66.4% 1.9%
Covered lines: 17818 14694 -3124
Coverable lines: 27584 22106 -5478
Total lines: 60678 60595 -83
Branch coverage: 50.2% 51.2% 1.0%
Covered branches: 2534 2512 -22
Total branches: 5045 4901 -144
Method coverage: Feature is only available for sponsors

@NycroV
Copy link
Collaborator Author

NycroV commented Oct 10, 2024

I'll probably merge this PR in the next few days if no one has any issues. The code changes are very minor, and it's been verified functional. Small bug fix!

@NycroV NycroV merged commit fc7e926 into dev Oct 13, 2024
7 checks passed
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.

Adding a playlist via "QueuedLavalinkPlayerExtensions" does not work
1 participant