Skip to content

Commit 0061626

Browse files
authored
World news Locale fixes (#19)
* Fix Gnews API request for locales * Update VERSION
1 parent b4b2c00 commit 0061626

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Diff for: VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7
1+
0.7.1

Diff for: src/main/java/it/garambo/retrosearch/news/scheduled/NewsScheduledTask.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ private void updateNews() throws Exception {
3838
.execute(
3939
() -> {
4040
for (Locale locale : locales) {
41+
String language = locale.getLanguage().toLowerCase();
42+
String country = locale.getCountry().toLowerCase();
4143
try {
42-
List<Article> articles =
43-
apiClient.fetchNews(locale.getLanguage(), locale.getCountry()).articles();
44+
List<Article> articles = apiClient.fetchNews(language, country).articles();
4445
newArticles.put(locale.getDisplayCountry(), articles);
4546
log.info("Fetched news for {}", locale);
4647
Thread.sleep(settings.getRateLimiter());

Diff for: src/main/resources/application.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ retrosearch.html.version=3.2
66
retrosearch.news.enable=${NEWS_ACTIVE:false}
77
retrosearch.news.api.key=${NEWS_API_KEY:}
88
retrosearch.news.api.rate.limiter=${NEWS_API_RATE_LIMITER:3000}
9-
retrosearch.news.api.locales=${NEWS_API_LOCALES:en_US,en_UK,it_IT,de_DE}
9+
retrosearch.news.api.locales=${NEWS_API_LOCALES:en_US,en_GB,it_IT,de_DE}
1010

1111
retrosearch.sports.football.enable=${FOOTBALL_API_ACTIVE:false}
1212
retrosearch.sports.football.api.key=${FOOTBALL_API_KEY:}

0 commit comments

Comments
 (0)