diff --git a/legendary/models/manifest.py b/legendary/models/manifest.py index 3e49867..c43cc39 100644 --- a/legendary/models/manifest.py +++ b/legendary/models/manifest.py @@ -522,6 +522,21 @@ class FML: logger.warning(f'Did not read {diff} bytes from chunk part!') bio.seek(diff) + # MD5 hash + MIME type + if _fml.version >= 1: + for fm in _fml.elements: + _has_md5 = struct.unpack('= 2: + for fm in _fml.elements: + fm.hash_sha256 = bio.read(32) + # we have to calculate the actual file size ourselves for fm in _fml.elements: fm.file_size = sum(c.size for c in fm.chunk_parts) @@ -531,14 +546,15 @@ class FML: f'{_fml.size - size_read} bytes missing, skipping...') bio.seek(_fml.size - size_read, 1) # downgrade version to prevent issues during serialisation - _fml.version = 1 + _fml.version = 2 return _fml def write(self, bio): fml_start = bio.tell() bio.write(struct.pack('