Skip to content

Commit

Permalink
Minor bugfix: update filesize when adding locally copied chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
elonen committed Jan 6, 2020
1 parent 2ae08c1 commit d8ff0cd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lanscatter/chunker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = ()):
"""
Expand Down

0 comments on commit d8ff0cd

Please sign in to comment.