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

Shuffle/Reorder Songs #270

Open
Colter-Hammer opened this issue May 10, 2019 · 6 comments
Open

Shuffle/Reorder Songs #270

Colter-Hammer opened this issue May 10, 2019 · 6 comments

Comments

@Colter-Hammer
Copy link

People seem to add songs in huge lists by artist, so I get full albums of the same people.
It would be awesome to be able to either shuffle the songs, or manually reorder them. I've been trying to find if this is possible or already requested, but I haven't found anything.

Love what you guys are doing!
Thanks!

@c-dot-gonz
Copy link

I'd also like to second this feature. Sometimes if people don't feel like voting for songs (or don't know the other songs well enough to vote on them), one person will be able to monopolize the time by putting in all their requests at once.

Ideally this would work, at least in my use case, is by shuffling all available songs in the queue, and when a song is voted on, it moves it to the top like normal.

It'd be even better if it could shuffle through contributors and not just random songs. So if I have 4 people adding songs, instead of choosing random songs from all submitted songs, it chooses a random song from person 2, then person 4, then person 3, then person 1, and then generates a new random permutation of 1-4 after the last person's song is played.

@leolabs
Copy link
Member

leolabs commented Jan 31, 2022

This is a cool idea! I'm not sure how to implement this efficiently. Currently, we calculate an ordering score based on the date a song was added and the number of votes (vote-processor.ts).

Maybe we could add a random factor to this score when a new track is added to the queue. This wouldn't have a round-robin behavior like you described, but it would make sure that if multiple people add songs, it's not possible for one person to abuse the system.

We also have a setting to disable adding multiple songs from the same search results list to avoid spamming.

@c-dot-gonz
Copy link

c-dot-gonz commented Feb 1, 2022

I have very limited knowledge of coding (mostly limited to a vague understanding of JS), but maybe some general process like:
-attach an identifier for each user who has added a song (an arbitrary user number based on IP or a device ID, for example; I imagine you already do this as a way to prevent users from voting on their own songs)
-store all identifiers for users in an array ("user array")
-if a song is played with no votes based on the date it was added, store the identifier for the user who added the current song in an array ("played array")
-the next time there are no votes, choose the next song added by a user still in the "user array", then move the user to the "played array"
-if no users exist in the "user array", pop out the last user in the array and unshift to the "user array"

That doesn't randomize the users like I initially suggested, but I'd be more than happy with a round robin method that's based on date added.

There's also likely a more elegant way to do it.

@c-dot-gonz
Copy link

I tried to take a look at this again and I agree that adding a random factor to the score would be good enough for my purposes.

I've tried to set line 129 of vote-processor.ts to the following code, but I keep running into all sorts of difficulties trying to get Festify unpackged from package.json (something seems to be up with my Python installation) so I'm unable to test it myself:

((track.added_at - partyCreated)) + ((Math.floor(Math.random() * 900 + 100)) * 1e7) - (voteCount * VOTE_FACTOR);

This is just to add a really big random number, big enough that it won't be accidentally surpassed in the same party, but small enough that VOTE_FACTOR still pushes items to the top of the list. A release where this could be toggled in settings would be ideal. I really wish I could get this sorted to be able to test it, but it will be a while until I have time to try.

@leolabs
Copy link
Member

leolabs commented Jul 8, 2022

Thanks for the suggestion! I think it would be a good idea to make this an option that admins can enable if they notice the normal system is being abused. In most cases, having a FIFO system is easier to explain to guests.

@NeoLegends do you have anything to add? :)

@c-dot-gonz
Copy link

I've just started using Festify again and wanted to check in to see if this feature could possibly be added. A toggle in the Admin panel to shuffle the order of songs with only 1 vote would be awesome. In addition to my "random number" suggestion, you could also split songs into 2 different arrays by vote count and shuffling the 1 vote array, then when something gets a second vote you move it into the other array, making sure that the songs in the 2+ vote array get played first.

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

No branches or pull requests

3 participants