Fix logic when deciding whether to hash for torrent

This commit is contained in:
Jake Moshenko 2016-01-05 12:13:26 -05:00
parent 8d5f4466d6
commit 44fcc7e44b

View file

@ -224,7 +224,7 @@ def _upload_chunk(namespace, repo_name, upload_uuid):
piece_hasher = None
# TODO remove this when all in-progress blob uploads reliably contain piece hashes
if start_offset == 0 and found.piece_sha_state is not None:
if start_offset == 0 or found.piece_sha_state is not None:
piece_hasher = PieceHasher(app.config['TORRENT_PIECE_SIZE'], start_offset, found.piece_hashes,
found.piece_sha_state)
input_fp = wrap_with_handler(input_fp, piece_hasher.update)