* forgot about MultiEpisode type Episode objects...

This commit is contained in:
Reinhard Pointner 2012-10-15 18:04:38 +00:00
parent e9cada4393
commit 04b6d25030
3 changed files with 14 additions and 2 deletions

View File

@ -231,7 +231,7 @@ class EpisodeListMatcher implements AutoCompleteMatcher {
for (Future<List<Match<File, ?>>> future : executor.invokeAll(taskPerFolder)) {
// make sure each episode has unique object data
for (Match<File, ?> it : future.get()) {
matches.add(new Match<File, Episode>(it.getValue(), new Episode((Episode) it.getCandidate())));
matches.add(new Match<File, Episode>(it.getValue(), ((Episode) it.getCandidate()).clone()));
}
}
@ -243,7 +243,7 @@ class EpisodeListMatcher implements AutoCompleteMatcher {
for (File file : derivateFiles) {
for (Match<File, ?> match : matches) {
if (file.getParentFile().equals(match.getValue().getParentFile()) && isDerived(file, match.getValue()) && match.getCandidate() instanceof Episode) {
derivateMatches.add(new Match<File, Object>(file, new Episode((Episode) match.getCandidate())));
derivateMatches.add(new Match<File, Object>(file, ((Episode) match.getCandidate()).clone()));
break;
}
}

View File

@ -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);

View File

@ -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());