Request preferred language and/or English (not supported by the API right now, but might in the future)

This commit is contained in:
Reinhard Pointner 2016-05-25 23:53:12 +08:00
parent 791fa79658
commit 74445dcc43
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider implements Artwor
// TODO support for default language => https://trello.com/c/dyEhtfky/16-handle-multiple-languages-in-the-accept-language-header
if (locale != null && locale != Locale.ROOT) {
header.put("Accept-Language", locale.getLanguage());
header.put("Accept-Language", Stream.of(locale, Locale.ENGLISH).map(Locale::getLanguage).distinct().collect(joining(", ")));
}
header.put("Accept", "application/json");
header.put("Authorization", "Bearer " + getAuthorizationToken());