ständig wiederholende songs verhindern

pull/24/head
eric 2025-08-07 18:46:48 +02:00
parent 063e85bf58
commit 2d473ebdd9
1 changed files with 11 additions and 0 deletions

View File

@ -152,8 +152,19 @@ private void broadcastRoundResult(String gameId) {
}else{
// nächste Runde starten
// ...
new Thread(() -> {
try { Thread.sleep(4000); } catch (InterruptedException ignored) {}
// Songs erneut sammeln
var currentGame = service.getOrCreateGame(gameId);
List<String> allTracks = new ArrayList<>();
for (String player : currentGame.players()) {
allTracks.addAll(authService.getRecentTracks(player));
}
if (!allTracks.isEmpty()) {
// Neue Runde starten
service.startRound(gameId, allTracks);
}
broadcastRoundStart(gameId);
}).start();
}