exclude files present locally from search results
This commit is contained in:
@@ -72,6 +72,7 @@ public class Core {
|
|||||||
private final HasherService hasherService
|
private final HasherService hasherService
|
||||||
private final DownloadManager downloadManager
|
private final DownloadManager downloadManager
|
||||||
private final DirectoryWatcher directoryWatcher
|
private final DirectoryWatcher directoryWatcher
|
||||||
|
final FileManager fileManager
|
||||||
|
|
||||||
public Core(MuWireSettings props, File home, String myVersion) {
|
public Core(MuWireSettings props, File home, String myVersion) {
|
||||||
this.home = home
|
this.home = home
|
||||||
@@ -155,7 +156,7 @@ public class Core {
|
|||||||
|
|
||||||
|
|
||||||
log.info "initializing file manager"
|
log.info "initializing file manager"
|
||||||
FileManager fileManager = new FileManager(eventBus, props)
|
fileManager = new FileManager(eventBus, props)
|
||||||
eventBus.register(FileHashedEvent.class, fileManager)
|
eventBus.register(FileHashedEvent.class, fileManager)
|
||||||
eventBus.register(FileLoadedEvent.class, fileManager)
|
eventBus.register(FileLoadedEvent.class, fileManager)
|
||||||
eventBus.register(FileDownloadedEvent.class, fileManager)
|
eventBus.register(FileDownloadedEvent.class, fileManager)
|
||||||
|
@@ -38,7 +38,7 @@ class SearchTabModel {
|
|||||||
|
|
||||||
void handleResult(UIResultEvent e) {
|
void handleResult(UIResultEvent e) {
|
||||||
if (uiSettings.excludeLocalResult &&
|
if (uiSettings.excludeLocalResult &&
|
||||||
e.sender == core.me)
|
core.fileManager.rootToFiles.containsKey(e.infohash))
|
||||||
return
|
return
|
||||||
runInsideUIAsync {
|
runInsideUIAsync {
|
||||||
def bucket = hashBucket.get(e.infohash)
|
def bucket = hashBucket.get(e.infohash)
|
||||||
@@ -64,7 +64,8 @@ class SearchTabModel {
|
|||||||
void handleResultBatch(UIResultEvent[] batch) {
|
void handleResultBatch(UIResultEvent[] batch) {
|
||||||
runInsideUIAsync {
|
runInsideUIAsync {
|
||||||
batch.each {
|
batch.each {
|
||||||
if (uiSettings.excludeLocalResult && it.sender == core.me)
|
if (uiSettings.excludeLocalResult &&
|
||||||
|
core.fileManager.rootToFiles.containsKey(it.infohash))
|
||||||
return
|
return
|
||||||
def bucket = hashBucket.get(it.infohash)
|
def bucket = hashBucket.get(it.infohash)
|
||||||
if (bucket == null) {
|
if (bucket == null) {
|
||||||
|
Reference in New Issue
Block a user