X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Frhynodge%2Ffilters%2FEpisodeFilter.java;h=7709d9e4a00e051fb61716a6e63c99d1f92d2fa7;hb=5253e286451ddd50cc5f94654f0e8d04322846cf;hp=91fe098e19f22600f146bcaf002294729cc3300c;hpb=6f69aff66ba5617d0bb27874014b4274bc551ab8;p=rhynodge.git diff --git a/src/main/java/net/pterodactylus/rhynodge/filters/EpisodeFilter.java b/src/main/java/net/pterodactylus/rhynodge/filters/EpisodeFilter.java index 91fe098..7709d9e 100644 --- a/src/main/java/net/pterodactylus/rhynodge/filters/EpisodeFilter.java +++ b/src/main/java/net/pterodactylus/rhynodge/filters/EpisodeFilter.java @@ -19,7 +19,8 @@ package net.pterodactylus.rhynodge.filters; import static com.google.common.base.Preconditions.checkState; -import java.util.LinkedHashMap; +import java.util.HashMap; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -57,13 +58,15 @@ public class EpisodeFilter implements Filter { checkState(state instanceof TorrentState, "state is not a TorrentState but a %s!", state.getClass()); TorrentState torrentState = (TorrentState) state; - LinkedHashMap episodes = new LinkedHashMap(); + Map episodes = new HashMap(); for (TorrentFile torrentFile : torrentState) { Episode episode = extractEpisode(torrentFile); if (episode == null) { continue; } - episodes.put(episode, episode); + if (!episodes.containsKey(episode)) { + episodes.put(episode, episode); + } episode = episodes.get(episode); episode.addTorrentFile(torrentFile); }