Only set an album image ID if it is null.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Album.java
index 88029e1..56bddb2 100644 (file)
@@ -180,7 +180,7 @@ public class Album implements Fingerprintable {
                        image.getAlbum().removeImage(image);
                }
                image.setAlbum(this);
-               if (imageIds.isEmpty()) {
+               if (imageIds.isEmpty() && (albumImage == null)) {
                        albumImage = image.getId();
                }
                if (!imageIds.contains(image.getId())) {
@@ -367,6 +367,9 @@ public class Album implements Fingerprintable {
                fingerprint.append("ID(").append(id).append(')');
                fingerprint.append("Title(").append(title).append(')');
                fingerprint.append("Description(").append(description).append(')');
+               if (albumImage != null) {
+                       fingerprint.append("AlbumImage(").append(albumImage).append(')');
+               }
 
                /* add nested albums. */
                fingerprint.append("Albums(");