feat/40-reroll-on-disinterest #54

Merged
kenobi merged 73 commits from feat/40-reroll-on-disinterest into master 2023-11-19 20:24:36 +01:00
Showing only changes of commit 91ec2ece7e - Show all commits

View File

@ -58,14 +58,14 @@ export default class VoteController {
public async handleReroll(voteMessage: VoteMessage, guild: Guild, guildId: string, requestId: string) {
//get movies that already had votes to give them a second chance
magnetotail marked this conversation as resolved Outdated

Parameter die eine Message sind heißen oft "message", manchmal aber auch "msg". sollte vereinheitlicht sein

Parameter die eine Message sind heißen oft "message", manchmal aber auch "msg". sollte vereinheitlicht sein
66507cb08fa50ba3a7be28388c55b21227fb2261

fc64728a78

Jetzt sollten alle Occurences beseitigt sein.

fc64728a780f99b56aebff7f0a7c5d24a901d90d Jetzt sollten alle Occurences beseitigt sein.
const voteInfo = await this.parseVoteInfoFromVoteMessage(voteMessage, requestId)
const voteInfo: VoteMessageInfo = await this.parseVoteInfoFromVoteMessage(voteMessage, requestId)
// get movies from jellyfin to fill the remaining slots
const newMovieCount = config.bot.random_movie_count - voteInfo.votes.filter(x => x.count > 2).length
const newMovies = await this.yavinJellyfinHandler.getRandomMovieNames(newMovieCount, guildId, requestId)
const newMovieCount: number = config.bot.random_movie_count - voteInfo.votes.filter(x => x.count > 2).length
const newMovies: string[] = await this.yavinJellyfinHandler.getRandomMovieNames(newMovieCount, guildId, requestId)
magnetotail marked this conversation as resolved Outdated

above WHAT threshold? What does it do??

above WHAT threshold? What does it do??
20da25f2bf9a473704f8b4660e5f05183679ba39

Mit einem Kommentar versehen und entsprechend deines vorschlags umbenannt

Mit einem Kommentar versehen und entsprechend deines vorschlags umbenannt
// merge
magnetotail marked this conversation as resolved Outdated

threshold seems to be a magic number

threshold seems to be a magic number

Or rename method to "hasAtLeastOneVote"

Or rename method to "hasAtLeastOneVote"
296a490e935cbdb79b70d73d2df9bc12a5774c53

done

done
const movies = newMovies.concat(voteInfo.votes.map(x => x.movie))
const movies: string[] = newMovies.concat(voteInfo.votes.map(x => x.movie))
// create new message
await this.closePoll(guild, requestId)