Fix PropertyBindings bugs

This commit is contained in:
Reinhard Pointner 2017-06-05 15:21:34 +08:00
parent 41bb712dc6
commit ec4ddf40c4
2 changed files with 2 additions and 8 deletions

View File

@ -1245,7 +1245,7 @@ public class MediaBindingBean {
}
private AssociativeScriptObject createPropertyBindings(Object object) {
return new AssociativeScriptObject(new PropertyBindings(object, null)) {
return new AssociativeScriptObject(new PropertyBindings(object)) {
@Override
public Object getProperty(String name) {

View File

@ -1,29 +1,24 @@
package net.filebot.similarity;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import net.filebot.format.PropertyBindings;
public class CrossPropertyMetric implements SimilarityMetric {
private SimilarityMetric metric;
public CrossPropertyMetric(SimilarityMetric metric) {
this.metric = metric;
}
public CrossPropertyMetric() {
this.metric = new StringEqualsMetric();
}
@Override
public float getSimilarity(Object o1, Object o2) {
Map<String, Object> m1 = getProperties(o1);
@ -53,9 +48,8 @@ public class CrossPropertyMetric implements SimilarityMetric {
return feedback / keys.size();
}
protected Map<String, Object> getProperties(Object object) {
return new PropertyBindings(object, null);
return new PropertyBindings(object);
}
}