Store new Sones that can not be loaded
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 21 Jul 2015 20:36:29 +0000 (22:36 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 21 Jul 2015 20:36:29 +0000 (22:36 +0200)
...because they were never saved so everything’s still peachy.

src/main/java/net/pterodactylus/sone/core/Core.java

index fe0907f..da209d8 100644 (file)
@@ -651,6 +651,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                        soneInserters.put(sone, soneInserter);
                }
                loadSone(sone);
+               database.storeSone(sone);
                sone.setStatus(SoneStatus.idle);
                soneInserter.start();
                return sone;
@@ -1085,7 +1086,6 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                        for (Album album : topLevelAlbums) {
                                sone.getRootAlbum().addAlbum(album);
                        }
-                       database.storeSone(sone);
                        synchronized (soneInserters) {
                                soneInserters.get(sone).setLastInsertFingerprint(lastInsertFingerprint);
                        }