diff --git a/source/net/sourceforge/filebot/ui/panel/rename/AutoEpisodeListMatcher.java b/source/net/sourceforge/filebot/ui/panel/rename/AutoFetchEpisodeListMatcher.java similarity index 93% rename from source/net/sourceforge/filebot/ui/panel/rename/AutoEpisodeListMatcher.java rename to source/net/sourceforge/filebot/ui/panel/rename/AutoFetchEpisodeListMatcher.java index 89c83792..c6b4590e 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/AutoEpisodeListMatcher.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/AutoFetchEpisodeListMatcher.java @@ -33,7 +33,7 @@ import net.sourceforge.filebot.web.SearchResult; import net.sourceforge.tuned.FileUtilities; -class AutoEpisodeListMatcher extends SwingWorker>, Void> { +class AutoFetchEpisodeListMatcher extends SwingWorker>, Void> { private final List files; @@ -42,7 +42,7 @@ class AutoEpisodeListMatcher extends SwingWorker>, Voi private final Collection metrics; - public AutoEpisodeListMatcher(EpisodeListClient client, List files, Collection metrics) { + public AutoFetchEpisodeListMatcher(EpisodeListClient client, List files, Collection metrics) { this.client = client; this.files = new LinkedList(files); this.metrics = new ArrayList(metrics); @@ -56,7 +56,7 @@ class AutoEpisodeListMatcher extends SwingWorker>, Voi protected Collection detectSeriesNames(Collection files) { // detect series name(s) from files - return new SeriesNameMatcher().matchAll(files.toArray(new File[files.size()])); + return new SeriesNameMatcher().matchAll(files.toArray(new File[0])); } @@ -109,7 +109,7 @@ class AutoEpisodeListMatcher extends SwingWorker>, Voi List> matches = new ArrayList>(); // group by subtitles first and then by files in general - for (List filesPerType : mapByFileType(files, MOVIE_FILES, SUBTITLE_FILES).values()) { + for (List filesPerType : mapByFileType(mediaFiles, MOVIE_FILES, SUBTITLE_FILES).values()) { Matcher matcher = new Matcher(filesPerType, episodes, metrics); matches.addAll(matcher.match()); } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java b/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java index 332f0944..d1940922 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java @@ -34,8 +34,6 @@ import net.sourceforge.filebot.web.TheTVDBClient; import net.sourceforge.tuned.ExceptionUtil; import net.sourceforge.tuned.ui.ActionPopup; import net.sourceforge.tuned.ui.LoadingOverlayPane; -import ca.odell.glazedlists.FunctionList; -import ca.odell.glazedlists.FunctionList.Function; import ca.odell.glazedlists.event.ListEvent; import ca.odell.glazedlists.event.ListEventListener; @@ -166,15 +164,14 @@ public class RenamePanel extends FileBotPanel { // clear names list model.names().clear(); - List files = new FunctionList(model.files(), new Function() { - - @Override - public File evaluate(FileEntry entry) { - return entry.getFile(); - } - }); + // gather File objects from model + List files = new ArrayList(); - AutoEpisodeListMatcher worker = new AutoEpisodeListMatcher(client, files, matchAction.getMetrics()) { + for (FileEntry entry : model.files()) { + files.add(entry.getFile()); + } + + AutoFetchEpisodeListMatcher worker = new AutoFetchEpisodeListMatcher(client, files, matchAction.getMetrics()) { @Override protected void done() {