1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 16:28:51 -05:00

Use Language objects instead of returning language codes/names

This commit is contained in:
Reinhard Pointner 2016-10-29 20:14:01 +08:00
parent 1854bc9f51
commit e34c9760af

View File

@ -590,14 +590,14 @@ public class MediaBindingBean {
}
@Define("languages")
public List<String> getSpokenLanguages() {
public List<Language> getSpokenLanguages() {
if (infoObject instanceof Movie) {
List<Locale> languages = (List<Locale>) getMetaInfo().getProperty("spokenLanguages");
return languages.stream().map(it -> it.getDisplayLanguage(Locale.ENGLISH)).collect(toList());
return languages.stream().map(Language::getLanguage).filter(Objects::nonNull).collect(toList());
}
if (infoObject instanceof Episode) {
String language = getSeriesInfo().getLanguage();
return singletonList(new Locale(language).getDisplayLanguage(Locale.ENGLISH));
return Stream.of(language).map(Language::findLanguage).filter(Objects::nonNull).collect(toList());
}
return null;
}
@ -779,8 +779,8 @@ public class MediaBindingBean {
}
@Define("textLanguages")
public List<String> getTextLanguageList() {
return getMediaInfo(StreamKind.Text, "Language/String").filter(Objects::nonNull).distinct().collect(toList());
public List<Language> getTextLanguageList() {
return getMediaInfo(StreamKind.Text, "Language").filter(Objects::nonNull).distinct().map(Language::findLanguage).filter(Objects::nonNull).collect(toList());
}
@Define("bitrate")