diff --git a/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java b/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java index a5ef1b62..db292f07 100644 --- a/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java +++ b/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java @@ -231,7 +231,7 @@ class EpisodeListMatcher implements AutoCompleteMatcher { for (Future>> future : executor.invokeAll(taskPerFolder)) { // make sure each episode has unique object data for (Match it : future.get()) { - matches.add(new Match(it.getValue(), new Episode((Episode) it.getCandidate()))); + matches.add(new Match(it.getValue(), ((Episode) it.getCandidate()).clone())); } } @@ -243,7 +243,7 @@ class EpisodeListMatcher implements AutoCompleteMatcher { for (File file : derivateFiles) { for (Match match : matches) { if (file.getParentFile().equals(match.getValue().getParentFile()) && isDerived(file, match.getValue()) && match.getCandidate() instanceof Episode) { - derivateMatches.add(new Match(file, new Episode((Episode) match.getCandidate()))); + derivateMatches.add(new Match(file, ((Episode) match.getCandidate()).clone())); break; } } diff --git a/source/net/sourceforge/filebot/web/Episode.java b/source/net/sourceforge/filebot/web/Episode.java index 2c29647b..63ffaab4 100644 --- a/source/net/sourceforge/filebot/web/Episode.java +++ b/source/net/sourceforge/filebot/web/Episode.java @@ -117,6 +117,12 @@ public class Episode implements Serializable { } + @Override + public Episode clone() { + return new Episode(this); + } + + @Override public String toString() { return EpisodeFormat.SeasonEpisode.format(this); diff --git a/source/net/sourceforge/filebot/web/MultiEpisode.java b/source/net/sourceforge/filebot/web/MultiEpisode.java index 19f2d43a..e53b9dcf 100644 --- a/source/net/sourceforge/filebot/web/MultiEpisode.java +++ b/source/net/sourceforge/filebot/web/MultiEpisode.java @@ -38,6 +38,12 @@ public class MultiEpisode extends Episode { } + @Override + public MultiEpisode clone() { + return new MultiEpisode(this.episodes); + } + + @Override public String toString() { return EpisodeFormat.SeasonEpisode.formatMultiEpisode(getEpisodes());