X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=ad96ab0b7dc25c2b5f3914c7a75c7aa1539abe3b;hb=b61436dafcb3eaae98c2352d188aaacb063031d0;hp=e67bf68c4ceeef7c0f530458f8ca85ecb9d75002;hpb=0df5e91852f737d760c5a9f54c5667309fbadcc2;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index e67bf68..ad96ab0 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -712,7 +712,6 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis */ public List getReplies(Post post) { Set sones = getSones(); - @SuppressWarnings("hiding") List replies = new ArrayList(); for (Sone sone : sones) { for (Reply reply : sone.getReplies()) { @@ -805,7 +804,6 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis * @return All bookmarked posts */ public Set getBookmarkedPosts() { - @SuppressWarnings("hiding") Set posts = new HashSet(); synchronized (bookmarkedPosts) { for (String bookmarkedPostId : bookmarkedPosts) { @@ -1356,7 +1354,6 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis } /* load posts. */ - @SuppressWarnings("hiding") Set posts = new HashSet(); while (true) { String postPrefix = sonePrefix + "/Posts/" + posts.size(); @@ -1379,7 +1376,6 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis } /* load replies. */ - @SuppressWarnings("hiding") Set replies = new HashSet(); while (true) { String replyPrefix = sonePrefix + "/Replies/" + replies.size(); @@ -1439,11 +1435,12 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis String albumTitle = configuration.getStringValue(albumPrefix + "/Title").getValue(null); String albumDescription = configuration.getStringValue(albumPrefix + "/Description").getValue(null); String albumParentId = configuration.getStringValue(albumPrefix + "/Parent").getValue(null); + String albumImageId = configuration.getStringValue(albumPrefix + "/AlbumImage").getValue(null); if ((albumTitle == null) || (albumDescription == null)) { logger.log(Level.WARNING, "Invalid album found, aborting load!"); return; } - Album album = getAlbum(albumId).setSone(sone).setTitle(albumTitle).setDescription(albumDescription); + Album album = getAlbum(albumId).setSone(sone).setTitle(albumTitle).setDescription(albumDescription).setAlbumImage(albumImageId); if (albumParentId != null) { Album parentAlbum = getAlbum(albumParentId, false); if (parentAlbum == null) { @@ -2090,6 +2087,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis configuration.getStringValue(albumPrefix + "/Title").setValue(album.getTitle()); configuration.getStringValue(albumPrefix + "/Description").setValue(album.getDescription()); configuration.getStringValue(albumPrefix + "/Parent").setValue(album.getParent() == null ? null : album.getParent().getId()); + configuration.getStringValue(albumPrefix + "/AlbumImage").setValue(album.getAlbumImage() == null ? null : album.getAlbumImage().getId()); } configuration.getStringValue(sonePrefix + "/Albums/" + albumCounter + "/ID").setValue(null);