🚸 Only lock Sone if it doesn’t have images, either
[Sone.git] / 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);
                }