From 91c4f73f647aabe99e44bc3d2fadb4c494d3b621 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 9 Oct 2013 21:47:21 +0200 Subject: [PATCH] Use the memory database to create all albums. --- src/main/java/net/pterodactylus/sone/core/Core.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); -- 2.7.4