1
0
Fork 0
mirror of https://github.com/qurator-spk/modstool.git synced 2025-08-07 00:29:55 +02:00

🐛 MODS/get_mets_div: Return empty list in case an ID is not found

This commit is contained in:
Mike Gerber 2025-08-06 20:17:10 +02:00
parent a9d650e345
commit eae273452c

View file

@ -432,6 +432,8 @@ def pages_to_dict(mets, raise_errors=True) -> List[Dict]:
def get_mets_div(*, ID):
if ID:
return structMap_LOGICAL.findall(f'.//mets:div[@ID="{ID}"]', ns)
else:
return []
for page in div_physSequence:
# TODO sort by ORDER?