set path to shared parent when loading downloaded files too

java-i2p-warning
Zlatin Balevsky 2022-08-29 12:08:51 +01:00
parent d19bff6ab2
commit 7d3f004ae3
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 5 additions and 3 deletions

View File

@ -102,6 +102,10 @@ abstract class BasePersisterService extends Service{
publishedTimestamp = json.publishedTimestamp publishedTimestamp = json.publishedTimestamp
} }
Path path = null
if (json.pathToSharedParent != null)
path = Path.of(json.pathToSharedParent)
if (json.sources != null) { if (json.sources != null) {
List sources = (List)json.sources List sources = (List)json.sources
Set<Destination> sourceSet = sources.stream().map({ d -> new Destination(d.toString())}).collect Collectors.toSet() Set<Destination> sourceSet = sources.stream().map({ d -> new Destination(d.toString())}).collect Collectors.toSet()
@ -109,12 +113,10 @@ abstract class BasePersisterService extends Service{
if (published) if (published)
df.publish(publishedTimestamp) df.publish(publishedTimestamp)
df.setComment(json.comment) df.setComment(json.comment)
df.setPathToSharedParent(path)
return new FileLoadedEvent(loadedFile : df, infoHash: ih) return new FileLoadedEvent(loadedFile : df, infoHash: ih)
} }
Path path = null
if (json.pathToSharedParent != null)
path = Path.of(json.pathToSharedParent)
SharedFile sf = new SharedFile(file, ih.getRoot(), pieceSize) SharedFile sf = new SharedFile(file, ih.getRoot(), pieceSize)
sf.setPathToSharedParent(path) sf.setPathToSharedParent(path)