diff --git a/source/net/filebot/ui/rename/AutoDetectMatcher.java b/source/net/filebot/ui/rename/AutoDetectMatcher.java index ba62432f..9abd72d4 100644 --- a/source/net/filebot/ui/rename/AutoDetectMatcher.java +++ b/source/net/filebot/ui/rename/AutoDetectMatcher.java @@ -54,7 +54,7 @@ class AutoDetectMatcher implements AutoCompleteMatcher { log.log(Level.WARNING, "Failed group: " + it.getKey(), e); return Stream.empty(); } - }).sorted(comparing(Match::getValue, new OriginalOrder(files))).collect(toList()); + }).sorted(comparing(Match::getValue, OriginalOrder.of(files))).collect(toList()); } finally { workerThreadPool.shutdownNow(); } diff --git a/source/net/filebot/ui/rename/EpisodeListMatcher.java b/source/net/filebot/ui/rename/EpisodeListMatcher.java index 4603b90a..a481f264 100644 --- a/source/net/filebot/ui/rename/EpisodeListMatcher.java +++ b/source/net/filebot/ui/rename/EpisodeListMatcher.java @@ -137,7 +137,7 @@ class EpisodeListMatcher implements AutoCompleteMatcher { matches.addAll(derivateMatches); // restore original order - matches.sort(comparing(Match::getValue, new OriginalOrder(files))); + matches.sort(comparing(Match::getValue, OriginalOrder.of(files))); return matches; } diff --git a/source/net/filebot/ui/rename/MovieMatcher.java b/source/net/filebot/ui/rename/MovieMatcher.java index b6f5783b..ac02510c 100644 --- a/source/net/filebot/ui/rename/MovieMatcher.java +++ b/source/net/filebot/ui/rename/MovieMatcher.java @@ -217,7 +217,7 @@ class MovieMatcher implements AutoCompleteMatcher { }); // restore original order - matches.sort(comparing(Match::getValue, new OriginalOrder(files))); + matches.sort(comparing(Match::getValue, OriginalOrder.of(files))); return matches; } diff --git a/source/net/filebot/ui/rename/OriginalOrder.java b/source/net/filebot/ui/rename/OriginalOrder.java index 598a8449..f7620378 100644 --- a/source/net/filebot/ui/rename/OriginalOrder.java +++ b/source/net/filebot/ui/rename/OriginalOrder.java @@ -7,6 +7,10 @@ import java.util.Map; class OriginalOrder implements Comparator { + public static Comparator of(Collection values) { + return new OriginalOrder(values); + } + private Map index; public OriginalOrder(Collection values) {