zorchenhimer / MoviePolls

Voting to decide on a movie to watch with MovieNight
https://discord.gg/F2VSgjJ
16 stars 6 forks source link

Dynamic vote limit adaptation #109

Open CptPie opened 3 years ago

CptPie commented 3 years ago

As we discussed several times before we considered a dynamic way to allocate (increase) votes depending on the amount of movies added.

A simple formula would be: max(amountMovies/10,voteSetting) i.e. either we have the Votes configured in the server settings or if the calculated value is higher, this calculated vote count is used.

Ofcourse we would need to check edgecases where a user might have negative votes (since the movie count decreased since he spent all votes but got none back) but that shouldnt be too hard.

dbaudisch commented 3 years ago

Could the negative edgecase be solved with min(0, abs(max(amount / 10, voteSettings)))?

CptPie commented 3 years ago

Yeah, something like that could work. Nevertheless i think that negative votes already are cought (i.e. you cant vote if you have <1 votes) but better save then sorry :).

zorchenhimer commented 3 years ago

Negative votes are already handled properly. If you have less than zero votes, you need to remove votes from movies until you have a positive number of votes in order to place another vote.