From c29be071cfbafc8bf153194d514b30146120845b Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 28 Jun 2014 06:41:50 +0000 Subject: [PATCH] * upper list is based on xattr metadata, while lower list is just the fallback file object, when matching directly to xattr metadata --- source/net/filebot/ui/rename/RenamePanel.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/net/filebot/ui/rename/RenamePanel.java b/source/net/filebot/ui/rename/RenamePanel.java index 5921ae82..a7e12bdf 100644 --- a/source/net/filebot/ui/rename/RenamePanel.java +++ b/source/net/filebot/ui/rename/RenamePanel.java @@ -308,12 +308,19 @@ public class RenamePanel extends JComponent { try { getWindow(evt.getSource()).setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - ArrayList files = new ArrayList(renameModel.files()); - ArrayList objects = new ArrayList(files.size()); + List files = new ArrayList(renameModel.files()); + List objects = new ArrayList(files.size()); + List objectsTail = new ArrayList(); for (File file : files) { Object metaObject = MediaDetection.readMetaInfo(file); - objects.add(metaObject != null ? metaObject : file); + if (metaObject != null) { + objects.add(metaObject); // upper list is based on xattr metadata + } else { + objectsTail.add(file); // lower list is just the fallback file object + } } + objects.addAll(objectsTail); + renameModel.clear(); renameModel.addAll(objects, files); } finally {