Finishes exact sound questions

This commit is contained in:
2025-10-02 22:37:50 +02:00
parent 5914e19ae1
commit 329b7d5bbf
6 changed files with 194 additions and 23 deletions

View File

@@ -92,7 +92,7 @@ public class PracticeQuestionGeneratorImpl implements PracticeQuestionGenerator
p.enabledFetchers().stream().flatMap(f -> {
try {
final var fetcher = fetcherProvider.getObject(f);
return fetcher.fetch(p.bird()).sounds().stream();
return fetcher.fetch(p.bird()).sounds().stream().filter(i -> p.enabledSoundTypes().contains(i.type()));
} catch (final ProvisionException | FetchException e) {
logger.error("Failed to fetch sounds for bird {}", p.bird(), e);
return Stream.empty();
@@ -106,7 +106,7 @@ public class PracticeQuestionGeneratorImpl implements PracticeQuestionGenerator
p.enabledFetchers().stream().flatMap(f -> {
try {
final var fetcher = fetcherProvider.getObject(f);
return fetcher.fetch(p.bird()).pictures().stream();
return fetcher.fetch(p.bird()).pictures().stream().filter(i -> p.enabledPictureTypes().contains(i.type()));
} catch (final ProvisionException | FetchException e) {
logger.error("Failed to fetch images for bird {}", p.bird(), e);
return Stream.empty();