mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-02 08:25:02 -04:00
Refactor {languages} binding
This commit is contained in:
parent
96ecc4db9a
commit
3443fc0de7
@ -576,9 +576,16 @@ public class MediaBindingBean {
|
||||
}
|
||||
|
||||
@Define("languages")
|
||||
public Object getSpokenLanguages() {
|
||||
List<?> languages = infoObject instanceof Movie ? (List<?>) getMetaInfo().getProperty("spokenLanguages") : singletonList(getMetaInfo().getProperty("language"));
|
||||
return languages.stream().map(it -> new Locale(it.toString()).getDisplayLanguage(Locale.ENGLISH)).collect(toList());
|
||||
public List<String> getSpokenLanguages() {
|
||||
if (infoObject instanceof Movie) {
|
||||
List<Locale> languages = (List<Locale>) getMetaInfo().getProperty("spokenLanguages");
|
||||
return languages.stream().map(it -> it.getDisplayLanguage(Locale.ENGLISH)).collect(toList());
|
||||
}
|
||||
if (infoObject instanceof Episode) {
|
||||
String language = getSeriesInfo().getLanguage();
|
||||
return singletonList(new Locale(language).getDisplayLanguage(Locale.ENGLISH));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Define("actors")
|
||||
|
Loading…
Reference in New Issue
Block a user