diff --git a/source/net/filebot/similarity/EpisodeMetrics.java b/source/net/filebot/similarity/EpisodeMetrics.java index f49a8d2e..5f372cf6 100644 --- a/source/net/filebot/similarity/EpisodeMetrics.java +++ b/source/net/filebot/similarity/EpisodeMetrics.java @@ -208,10 +208,13 @@ public enum EpisodeMetrics implements SimilarityMetric { return stream(objects).map(EpisodeMetrics::normalizeObject).toArray(String[]::new); } + protected static final int MAX_FIELDS = 5; + protected Object[] fields(Object object) { if (object instanceof Episode) { Episode e = (Episode) object; - return StreamEx.of(e.getSeriesName(), e.getTitle()).append(e.getSeriesNames()).filter(Objects::nonNull).map(Normalization::removeTrailingBrackets).distinct().limit(5).toArray(); + Object[] names = StreamEx.of(e.getSeriesName(), e.getTitle()).append(e.getSeriesNames()).filter(Objects::nonNull).map(Normalization::removeTrailingBrackets).distinct().limit(MAX_FIELDS).toArray(); + return copyOf(names, MAX_FIELDS); } if (object instanceof File) {