diff --git a/source/net/filebot/ui/list/IndexedBindingBean.java b/source/net/filebot/ui/list/IndexedBindingBean.java index dc1d8b42..170a461b 100644 --- a/source/net/filebot/ui/list/IndexedBindingBean.java +++ b/source/net/filebot/ui/list/IndexedBindingBean.java @@ -1,5 +1,7 @@ package net.filebot.ui.list; +import static net.filebot.media.XattrMetaInfo.*; + import java.io.File; import java.util.List; import java.util.Map; @@ -16,7 +18,7 @@ public class IndexedBindingBean extends MediaBindingBean { private int to; public IndexedBindingBean(Object object, int i, int from, int to, List context) { - super(object, getMediaFile(object), getContext(context)); + super(getInfoObject(object), getMediaFile(object), getContext(context)); this.i = i; this.from = from; this.to = to; @@ -37,12 +39,26 @@ public class IndexedBindingBean extends MediaBindingBean { return to; } + private static Object getInfoObject(Object object) { + if (object instanceof File) { + File file = (File) object; + Object metaInfo = xattr.getMetaInfo(file); + if (metaInfo != null) { + return metaInfo; + } + } + return object; + } + private static File getMediaFile(Object object) { return object instanceof File ? (File) object : new File(object.toString()); } private static Map getContext(List context) { - return new EntryList(new FunctionList((List) context, IndexedBindingBean::getMediaFile), context); + List values = new FunctionList((List) context, IndexedBindingBean::getInfoObject); + List files = new FunctionList((List) context, IndexedBindingBean::getMediaFile); + + return new EntryList(files, values); } }