Skip to content

Commit

Permalink
Urgent fix to download's progress callback (#14).
Browse files Browse the repository at this point in the history
  • Loading branch information
mindstorm38 committed Jun 15, 2021
1 parent 6f189b8 commit e6b17c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion portablemc.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def download_file(self,
start_size += read_len

if progress_callback is not None:
progress_callback(dl_size, 0 if entry.size else entry.size, start_size, total_size)
progress_callback(dl_size, 0 if entry.size is None else entry.size, start_size, total_size)

if entry.size is not None and dl_size != entry.size:
raise DownloadCorruptedError("invalid_size")
Expand Down
2 changes: 1 addition & 1 deletion portablemc_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def download_file(self,
start_size += read_len

if progress_callback is not None:
progress_callback(dl_size, 0 if entry.size else entry.size, start_size, total_size)
progress_callback(dl_size, 0 if entry.size is None else entry.size, start_size, total_size)

if entry.size is not None and dl_size != entry.size:
raise DownloadCorruptedError("invalid_size")
Expand Down

0 comments on commit e6b17c5

Please sign in to comment.