NinjaCheetah / libWiiPy

A modern Python library for handling files and formats used by the Wii.
https://docs.ninjacheetah.dev/
MIT License
10 stars 1 forks source link

Feat: Read contents list from TMD and generate a list of ContentRecord objects #1

Closed NinjaCheetah closed 9 months ago

NinjaCheetah commented 9 months ago

The num_contents and content_record variables in the TMD class currently go unused because the content info in the TMD isn't being read. To be able to properly handle WADs in any capacity, the content records contained in the TMD need to be read, and a list of these records needs to be generated from them. This will allow easy reading of the Content ID, Content Type, Content Size, and Content Hash of each content belonging to a title.

See the documentation at: https://wiibrew.org/wiki/Title_metadata for more information.

A data class for the content records does already exist and should be ready for use?

rvtr commented 9 months ago

Thanks for the edit on tmd.py. Just making one small change to the error for get_content_record(). Currently looks a bit weird.

IndexError: Invalid content record! TMD lists '9' contents but index was '9'!