fix disabling sharing of downloaded files

pull/4/head
Zlatin Balevsky 2019-06-08 01:35:03 +01:00
parent b5cb31c23d
commit 60776829b9
1 changed files with 9 additions and 9 deletions

View File

@ -26,20 +26,20 @@ class FileManager {
this.eventBus = eventBus this.eventBus = eventBus
} }
void onFileHashedEvent(FileHashedEvent e) { void onFileHashedEvent(FileHashedEvent e) {
if (settings.shareDownloadedFiles) { if (e.sharedFile != null)
if (e.sharedFile != null) addToIndex(e.sharedFile)
addToIndex(e.sharedFile) }
}
}
void onFileLoadedEvent(FileLoadedEvent e) { void onFileLoadedEvent(FileLoadedEvent e) {
addToIndex(e.loadedFile) addToIndex(e.loadedFile)
} }
void onFileDownloadedEvent(FileDownloadedEvent e) { void onFileDownloadedEvent(FileDownloadedEvent e) {
addToIndex(e.downloadedFile) if (settings.shareDownloadedFiles) {
} addToIndex(e.downloadedFile)
}
}
private void addToIndex(SharedFile sf) { private void addToIndex(SharedFile sf) {
log.info("Adding shared file " + sf.getFile()) log.info("Adding shared file " + sf.getFile())