Only add the torrent if it doesn’t already exist.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 19 Feb 2013 19:15:49 +0000 (20:15 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 19 Feb 2013 19:15:49 +0000 (20:15 +0100)
src/main/java/net/pterodactylus/rhynodge/states/EpisodeState.java

index 7ed3dce..5d494e5 100644 (file)
@@ -194,7 +194,9 @@ public class EpisodeState extends AbstractState implements Iterable<Episode> {
                 *            The torrent file to add
                 */
                public void addTorrentFile(TorrentFile torrentFile) {
-                       torrentFiles.add(torrentFile);
+                       if (!torrentFiles.contains(torrentFile)) {
+                               torrentFiles.add(torrentFile);
+                       }
                }
 
                //