Skip to content

Commit

Permalink
fix: loading translations via changed date (#44)
Browse files Browse the repository at this point in the history
When using the units API and getting the translations via
`"changed:>=YYYY-MM-DD"` you will not get all translations wanted.
Translations which were only once touched get only an added date.
So, those translations will not be fetched.

This changes query for the `changed` and `added` fields to fix this.

Fixes #43
  • Loading branch information
derkoe authored Sep 16, 2022
1 parent a5c7ecb commit 36dc005
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,11 @@ private static String formatTimestampIso(long timestamp) {
}

private void loadTranslation(String code, Properties properties, long timestamp) {
String currentQuery = query + " AND changed:>=" + formatTimestampIso(timestamp);
String currentQuery = query;
if (timestamp > 0L) {
String timestampStr = formatTimestampIso(timestamp);
currentQuery += " AND (added:>=" + timestampStr + " OR changed:>=" + timestampStr + ")";
}

try {
RequestEntity<Void> request = RequestEntity
Expand Down

0 comments on commit 36dc005

Please sign in to comment.