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

Bug in priority queue #9

Open
BuenoVini opened this issue Sep 12, 2022 · 0 comments
Open

Bug in priority queue #9

BuenoVini opened this issue Sep 12, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@BuenoVini
Copy link
Owner

A bug was found in the priority queue.

If a user adds two songs on the queue (priority 0 and 1) and then the first one is being played, if they delete the second one and vote for it again, it's going to be a priority 0.

The reason seems to be related with verifying the CurrentlyPlayingVote and which Client voted for it.

Suggestion:
In EnqueueVote() in the SparkflyManager.cs change to:

if (priority == 0 && PreviouslyPlayedVotes.Any(v => v.Client.Id == client.Id) && CurrentlyPlayingVote.Client.Id != client.Id)
    priority = 1;
@BuenoVini BuenoVini added the bug Something isn't working label Sep 12, 2022
BuenoVini added a commit that referenced this issue Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant