From d954387e41eb2e846edb0653f951404bc0eaac19 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sun, 20 Oct 2019 11:59:48 +0100 Subject: [PATCH] fix showing of local files in results --- .../main/groovy/com/muwire/core/search/ResultsSender.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy b/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy index 5a688f75..763464cb 100644 --- a/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy +++ b/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy @@ -57,6 +57,7 @@ class ResultsSender { void sendResults(UUID uuid, SharedFile[] results, Destination target, boolean oobInfohash, boolean compressedResults) { log.info("Sending $results.length results for uuid $uuid to ${target.toBase32()} oobInfohash : $oobInfohash") if (target.equals(me.destination)) { + def uiResultEvents = [] results.each { long length = it.getFile().length() int pieceSize = it.getPieceSize() @@ -78,8 +79,9 @@ class ResultsSender { sources : suggested, comment : comment ) - eventBus.publish(uiResultEvent) + uiResultEvents << uiResultEvent } + eventBus.publish(new UIResultBatchEvent(uuid : uuid, results : uiResultEvents)) } else { executor.execute(new ResultSendJob(uuid : uuid, results : results, target: target, oobInfohash : oobInfohash, compressedResults : compressedResults))