From: David ‘Bombe’ Roden Date: Tue, 11 Sep 2012 04:59:56 +0000 (+0200) Subject: Only add an album if it does not exist. X-Git-Tag: 0.8.3^2~43 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=55c9d543dfc4a1ece97a6c8a0b8e8f49ea814bd1;p=Sone.git Only add an album if it does not exist. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index ac6e41a..99d65ec 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -791,7 +791,9 @@ public class Sone implements Fingerprintable, Comparable { */ 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); + } } /**