denshoproject / ddr-cmdln

Command-line tools for automating the Densho Digital Repository's various processes.
Other
0 stars 2 forks source link

Refactor Entity.children #141

Closed gjost closed 5 years ago

gjost commented 5 years ago

While working on implementing deletion of child Entities, it became apparent that the internal handling of Entity children was unnecessarily baroque. It recreated the METS children / file_groups structure leading to complications. This change reads and writes the METS structure but stores all Entity children in a single list, sorted according to a predetermined order (Entities first, then mezzanine, master, etc Files). When you want a certain subtype just iterate through the list and pick out the ones you want.