From edc6cbcccc641119cabf14f82237104c901dcc7c Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 29 Nov 2019 11:55:16 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=9A=B8=20Only=20lock=20Sone=20if=20it=20do?= =?utf8?q?esn=E2=80=99t=20have=20images,=20either?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/core/Core.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.7.4