From 094b9ac2b00425189ec63c74b3c77d136bfbb699 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sat, 2 Nov 2019 00:27:12 +0000 Subject: [PATCH] restore behavior where watched directories get scanned on startup --- core/src/main/groovy/com/muwire/core/files/HasherService.groovy | 2 ++ gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/groovy/com/muwire/core/files/HasherService.groovy b/core/src/main/groovy/com/muwire/core/files/HasherService.groovy index 9abc8b72..2695f3db 100644 --- a/core/src/main/groovy/com/muwire/core/files/HasherService.groovy +++ b/core/src/main/groovy/com/muwire/core/files/HasherService.groovy @@ -34,6 +34,8 @@ class HasherService { return if (fileManager.fileToSharedFile.containsKey(canonical)) return + if (fileManager.negativeTree.fileToNode.containsKey(canonical)) + return if (canonical.getName().endsWith(".mwcomment") && canonical.length() <= Constants.MAX_COMMENT_LENGTH) eventBus.publish(new SideCarFileEvent(file : canonical)) else if (hashed.add(canonical)) diff --git a/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy b/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy index 6c58a6af..4b3a665d 100644 --- a/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy +++ b/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy @@ -255,7 +255,7 @@ class MainFrameModel { void onAllFilesLoadedEvent(AllFilesLoadedEvent e) { runInsideUIAsync { - core.muOptions.watchedDirectories.each { core.eventBus.publish(new DirectoryWatchedEvent(directory : new File(it))) } + core.muOptions.watchedDirectories.each { core.eventBus.publish(new FileSharedEvent(file : new File(it))) } core.muOptions.trustSubscriptions.each { core.eventBus.publish(new TrustSubscriptionEvent(persona : it, subscribe : true))