1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

Improved error reporting for people that do --db TheTVDB --lang ITA

This commit is contained in:
Reinhard Pointner 2016-02-08 17:27:17 +00:00
parent e43e5f9f17
commit ec0f9293c7

View File

@ -83,6 +83,12 @@ public class TheTVDBClient extends AbstractEpisodeListProvider {
public String getLanguageCode(Locale locale) {
String code = locale.getLanguage();
// sanity check
if (code.length() != 2) {
// see http://thetvdb.com/api/BA864DEE427E384A/languages.xml
throw new IllegalArgumentException("Expecting 2-letter language code: " + code);
}
// Java language code => TheTVDB language code
if (code.equals("iw")) // Hebrew
return "he";