[models] Skip over unknown data in manifest

This commit is contained in:
derrod 2021-10-29 12:40:18 +02:00
parent d8cd885542
commit 22b9c5c932

View file

@ -526,8 +526,12 @@ class FML:
for fm in _fml.elements: for fm in _fml.elements:
fm.file_size = sum(c.size for c in fm.chunk_parts) fm.file_size = sum(c.size for c in fm.chunk_parts)
if bio.tell() - fml_start != _fml.size: if (size_read := bio.tell() - fml_start) != _fml.size:
raise ValueError('Did not read entire chunk data list!') logger.warning(f'Did not read entire file data list! Version: {_fml.version}, '
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
return _fml return _fml