diff --git a/core/src/main/groovy/com/muwire/core/Core.groovy b/core/src/main/groovy/com/muwire/core/Core.groovy index 650643dd..fa448837 100644 --- a/core/src/main/groovy/com/muwire/core/Core.groovy +++ b/core/src/main/groovy/com/muwire/core/Core.groovy @@ -72,6 +72,7 @@ public class Core { private final HasherService hasherService private final DownloadManager downloadManager private final DirectoryWatcher directoryWatcher + final FileManager fileManager public Core(MuWireSettings props, File home, String myVersion) { this.home = home @@ -155,7 +156,7 @@ public class Core { log.info "initializing file manager" - FileManager fileManager = new FileManager(eventBus, props) + fileManager = new FileManager(eventBus, props) eventBus.register(FileHashedEvent.class, fileManager) eventBus.register(FileLoadedEvent.class, fileManager) eventBus.register(FileDownloadedEvent.class, fileManager) diff --git a/gui/griffon-app/models/com/muwire/gui/SearchTabModel.groovy b/gui/griffon-app/models/com/muwire/gui/SearchTabModel.groovy index 85aeb9b0..54f0bbb4 100644 --- a/gui/griffon-app/models/com/muwire/gui/SearchTabModel.groovy +++ b/gui/griffon-app/models/com/muwire/gui/SearchTabModel.groovy @@ -38,7 +38,7 @@ class SearchTabModel { void handleResult(UIResultEvent e) { if (uiSettings.excludeLocalResult && - e.sender == core.me) + core.fileManager.rootToFiles.containsKey(e.infohash)) return runInsideUIAsync { def bucket = hashBucket.get(e.infohash) @@ -64,7 +64,8 @@ class SearchTabModel { void handleResultBatch(UIResultEvent[] batch) { runInsideUIAsync { batch.each { - if (uiSettings.excludeLocalResult && it.sender == core.me) + if (uiSettings.excludeLocalResult && + core.fileManager.rootToFiles.containsKey(it.infohash)) return def bucket = hashBucket.get(it.infohash) if (bucket == null) {