From: David ‘Bombe’ Roden Date: Wed, 9 Oct 2013 19:47:21 +0000 (+0200) Subject: Use the memory database to create all albums. X-Git-Tag: 0.8.8^2~16 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=91c4f73f647aabe99e44bc3d2fadb4c494d3b621;p=Sone.git Use the memory database to create all albums. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 8ce908b..0f0b6d3 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -52,7 +52,6 @@ import net.pterodactylus.sone.core.event.SoneLockedEvent; import net.pterodactylus.sone.core.event.SoneRemovedEvent; import net.pterodactylus.sone.core.event.SoneUnlockedEvent; import net.pterodactylus.sone.data.Album; -import net.pterodactylus.sone.data.AlbumImpl; import net.pterodactylus.sone.data.Client; import net.pterodactylus.sone.data.Image; import net.pterodactylus.sone.data.Post; @@ -641,7 +640,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, if (!create) { return null; } - Album newAlbum = new AlbumImpl(albumId); + Album newAlbum = database.newAlbumBuilder().withId(albumId).build(); database.storeAlbum(newAlbum); return newAlbum; } @@ -1601,7 +1600,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, * @return The new album */ public Album createAlbum(Sone sone, Album parent) { - AlbumImpl album = new AlbumImpl(); + Album album = database.newAlbumBuilder().randomId().build(); database.storeAlbum(album); album.setSone(sone); parent.addAlbum(album);