From: David ‘Bombe’ Roden Date: Fri, 29 Nov 2019 10:55:16 +0000 (+0100) Subject: 🚸 Only lock Sone if it doesn’t have images, either X-Git-Tag: v81^2~15^2~10 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=edc6cbcccc641119cabf14f82237104c901dcc7c;p=Sone.git 🚸 Only lock Sone if it doesn’t have images, either --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 5c1e537..d53e33d 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -24,6 +24,7 @@ import static com.google.common.primitives.Longs.tryParse; import static java.lang.String.format; import static java.util.logging.Level.WARNING; import static java.util.logging.Logger.getLogger; +import static net.pterodactylus.sone.data.AlbumsKt.getAllImages; import java.util.ArrayList; import java.util.Collection; @@ -634,7 +635,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, loadSone(sone); database.storeSone(sone); sone.setStatus(SoneStatus.idle); - if (sone.getPosts().isEmpty() && sone.getReplies().isEmpty()) { + if (sone.getPosts().isEmpty() && sone.getReplies().isEmpty() && getAllImages(sone.getRootAlbum()).isEmpty()) { // dirty hack lockSone(sone); }