/*
- * Sone - Core.java - Copyright © 2010–2019 David Roden
+ * Sone - Core.java - Copyright © 2010–2020 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
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;
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);
+ eventBus.post(new SoneLockedOnStartup(sone));
}
soneInserter.start();
return sone;