Compare commits

..

2 Commits

Author SHA1 Message Date
Zlatin Balevsky
853b9f67fc Release 0.6.10 2020-02-23 15:42:03 +00:00
Zlatin Balevsky
a505a2449a persist SharedFile on change of comments #35 2020-02-18 02:14:32 +00:00
4 changed files with 12 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ import com.muwire.core.UILoadedEvent
import com.muwire.core.files.AllFilesLoadedEvent
class CliLanterna {
private static final String MW_VERSION = "0.6.9"
private static final String MW_VERSION = "0.6.10"
private static volatile Core core

View File

@@ -268,6 +268,7 @@ public class Core {
eventBus.register(FileLoadedEvent.class, persisterFolderService)
eventBus.register(FileHashedEvent.class, persisterFolderService)
eventBus.register(FileUnsharedEvent.class, persisterFolderService)
eventBus.register(UICommentEvent.class, persisterFolderService)
log.info("initializing host cache")
File hostStorage = new File(home, "hosts.json")
@@ -469,7 +470,7 @@ public class Core {
}
}
Core core = new Core(props, home, "0.6.9")
Core core = new Core(props, home, "0.6.10")
core.startServices()
// ... at the end, sleep or execute script

View File

@@ -88,6 +88,10 @@ class PersisterFolderService extends BasePersisterService {
persistFile(loadedEvent.loadedFile, loadedEvent.infoHash)
}
}
void onUICommentEvent(UICommentEvent e) {
persistFile(e.sharedFile,null)
}
void load() {
log.fine("Loading...")
@@ -144,8 +148,10 @@ class PersisterFolderService extends BasePersisterService {
writer.println json
}
def hashListPath = getHashListPath(sf)
hashListPath.toFile().bytes = ih.hashList
if (ih != null) {
def hashListPath = getHashListPath(sf)
hashListPath.toFile().bytes = ih.hashList
}
log.fine("Time(ms) to write json+hashList: " + (System.currentTimeMillis() - startTime))
} as Runnable)
}

View File

@@ -1,5 +1,5 @@
group = com.muwire
version = 0.6.9
version = 0.6.10
i2pVersion = 0.9.44
groovyVersion = 2.4.15
slf4jVersion = 1.7.25