X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=04f7181337bc7b0138859f57ddf54d40ff769e50;hp=6292934c9ad04cb9f97ba3d763492ef5725c205a;hb=298e23049639ddbfc3e50507ed6e4bed990f2789;hpb=c8ba039a25db156ceed46a458d3f1964800a80d8 diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 6292934..04f7181 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -208,12 +208,12 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, * The database */ @Inject - public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, UpdateChecker updateChecker, WebOfTrustUpdater webOfTrustUpdater, EventBus eventBus, Database database) { + public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, SoneDownloader soneDownloader, UpdateChecker updateChecker, WebOfTrustUpdater webOfTrustUpdater, EventBus eventBus, Database database) { super("Sone Core"); this.configuration = configuration; this.freenetInterface = freenetInterface; this.identityManager = identityManager; - this.soneDownloader = new SoneDownloaderImpl(this, freenetInterface); + this.soneDownloader = soneDownloader; this.imageInserter = new ImageInserter(freenetInterface, freenetInterface.new InsertTokenSupplier()); this.updateChecker = updateChecker; this.webOfTrustUpdater = webOfTrustUpdater; @@ -1712,7 +1712,13 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, if (sone.isLocal()) { return; } - sone.setLatestEdition(fromNullable(tryParse(identity.getProperty("Sone.LatestEdition"))).or(sone.getLatestEdition())); + String newLatestEdition = identity.getProperty("Sone.LatestEdition"); + if (newLatestEdition != null) { + Long parsedNewLatestEdition = tryParse(newLatestEdition); + if (parsedNewLatestEdition != null) { + sone.setLatestEdition(parsedNewLatestEdition); + } + } soneDownloader.addSone(sone); soneDownloaders.execute(soneDownloader.fetchSoneAction(sone)); }