🚸 Only lock Sone if it doesn’t have images, either
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 29 Nov 2019 10:55:16 +0000 (11:55 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 29 Nov 2019 17:27:07 +0000 (18:27 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java

index 5c1e537..d53e33d 100644 (file)
@@ -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);
                }