Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Fixed selection of voting results for a specific day thus enabling di… #40

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,18 @@ public List<RatedTalk> getRatedTalks(final String conferenceDay) {
System.out.println("######## randomizedRatedTalksPerDay");
return randomizedRatedTalks();
} else {
return getVotingResults().entrySet().stream()
.filter(e -> e.getKey().dayId().equals(conferenceDay))
.map(Map.Entry::getValue)
.findFirst()
.orElse(List.of());
final Map<WeekDay, List<RatedTalk>> votingResults = getVotingResults();

return votingResults.entrySet().stream()
.filter(e -> e.getKey().dayId().equals(conferenceDay))
.map(Map.Entry::getValue)
.findFirst()
.orElseGet(() -> {
LOG.warn(
"Lookup of voting results for conferenceDay='{}' failed among the following keySet: {}",
conferenceDay, votingResults.keySet());
return List.of();
});
}
}

Expand Down Expand Up @@ -419,7 +426,9 @@ private static <T> T alternatives(final T... ts) {
protected static record WeekDay(String dayId) {

static WeekDay of(String date) {
return new WeekDay(LocalDate.parse(date).getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH));
return new WeekDay(LocalDate.parse(date).getDayOfWeek()
.getDisplayName(TextStyle.FULL, Locale.ENGLISH)
.toLowerCase(Locale.ENGLISH));
}
}
}