mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 08:48:51 -05:00
Use Language objects instead of returning language codes/names
This commit is contained in:
parent
1854bc9f51
commit
e34c9760af
@ -590,14 +590,14 @@ public class MediaBindingBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Define("languages")
|
@Define("languages")
|
||||||
public List<String> getSpokenLanguages() {
|
public List<Language> getSpokenLanguages() {
|
||||||
if (infoObject instanceof Movie) {
|
if (infoObject instanceof Movie) {
|
||||||
List<Locale> languages = (List<Locale>) getMetaInfo().getProperty("spokenLanguages");
|
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) {
|
if (infoObject instanceof Episode) {
|
||||||
String language = getSeriesInfo().getLanguage();
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
@ -779,8 +779,8 @@ public class MediaBindingBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Define("textLanguages")
|
@Define("textLanguages")
|
||||||
public List<String> getTextLanguageList() {
|
public List<Language> getTextLanguageList() {
|
||||||
return getMediaInfo(StreamKind.Text, "Language/String").filter(Objects::nonNull).distinct().collect(toList());
|
return getMediaInfo(StreamKind.Text, "Language").filter(Objects::nonNull).distinct().map(Language::findLanguage).filter(Objects::nonNull).collect(toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Define("bitrate")
|
@Define("bitrate")
|
||||||
|
Loading…
Reference in New Issue
Block a user