From d8ff0cdeae8c97811b384dcf697796aa75cd3156 Mon Sep 17 00:00:00 2001 From: Jarno Elonen Date: Mon, 6 Jan 2020 13:36:58 +0200 Subject: [PATCH] Minor bugfix: update filesize when adding locally copied chunks --- lanscatter/chunker.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lanscatter/chunker.py b/lanscatter/chunker.py index 8607724..4a89a74 100644 --- a/lanscatter/chunker.py +++ b/lanscatter/chunker.py @@ -129,6 +129,7 @@ def add(self, files: Iterable[FileAttribs] = (), chunks: Iterable[FileChunk] = ( if path not in self.files: self.files[path] = FileAttribs(path=path, size=0, mtime=int(time.time()), treehash=None) self.files[path].treehash = calc_tree_hash((c for c in self.chunks if c.path == path)) + self.files[path].size = sum((c.size for c in self.chunks if c.path == path)) def discard(self, paths: Iterable[str] = (), chunks: Iterable[FileChunk] = ()): """