Only add an album if it does not exist.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 11 Sep 2012 04:59:56 +0000 (06:59 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 11 Sep 2012 04:59:56 +0000 (06:59 +0200)
src/main/java/net/pterodactylus/sone/data/Sone.java

index ac6e41a..99d65ec 100644 (file)
@@ -791,7 +791,9 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
         */
        public void addAlbum(Album album) {
                Validation.begin().isNotNull("Album", album).check().isEqual("Album Owner", album.getSone(), this).check();
-               albums.add(album);
+               if (!albums.contains(album)) {
+                       albums.add(album);
+               }
        }
 
        /**