mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-02 08:25:02 -04:00
Make {localize} binding more self-documenting
This commit is contained in:
parent
a226a4de0f
commit
8ca67b9b64
@ -2,14 +2,18 @@ package net.filebot.format;
|
||||
|
||||
import groovy.lang.GroovyObjectSupport;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class DynamicBindings extends GroovyObjectSupport {
|
||||
|
||||
private Function<String, Object> map;
|
||||
private String[] keys;
|
||||
|
||||
public DynamicBindings(Function<String, Object> map) {
|
||||
public DynamicBindings(Function<String, Object> map, Stream<String> keys) {
|
||||
this.map = map;
|
||||
this.keys = keys.toArray(String[]::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -17,4 +21,9 @@ public class DynamicBindings extends GroovyObjectSupport {
|
||||
return map.apply(property);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Arrays.toString(keys);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ public class MediaBindingBean {
|
||||
}
|
||||
}
|
||||
return undefined(key);
|
||||
});
|
||||
}, Language.availableLanguages().stream().map(Language::getName));
|
||||
}
|
||||
|
||||
@Define("bitrate")
|
||||
|
Loading…
Reference in New Issue
Block a user