Set album image after parsing all images.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / SoneDownloader.java
index 4d63130..1caf186 100644 (file)
@@ -456,7 +456,7 @@ public class SoneDownloader extends AbstractService {
                                                return null;
                                        }
                                }
-                               Album album = core.getAlbum(id).setSone(sone).setTitle(title).setDescription(description).setAlbumImage(albumImageId);
+                               Album album = core.getAlbum(id).setSone(sone).setTitle(title).setDescription(description);
                                if (parent != null) {
                                        parent.addAlbum(album);
                                } else {
@@ -489,6 +489,7 @@ public class SoneDownloader extends AbstractService {
                                                album.addImage(image);
                                        }
                                }
+                               album.setAlbumImage(albumImageId);
                        }
                }