cjcodeproj / medialibrary

Python code to read XML media files
MIT License
2 stars 0 forks source link

AbstractContent needed a classification attribute #187

Closed cjcodeproj closed 3 months ago

cjcodeproj commented 3 months ago

A bug was discovered through unit tests in the AbstractContent class.

https://github.com/cjcodeproj/medialibrary/blob/f37e074d29e6ecdb38942ca38e92663f5176b7df/src/media/data/media/contents/internal.py#L38-L48

There should be a classification attribute that is set to None.

This was discovered during unit tests against the Movie class that did not have <classification> elements in the test data structures. Without the data structures, the attribute was never created, and it caused a problem when the MovieIndexEntry object was instantiated.

The work in #183 changes how indexes are set up. Indexes for content are now dedicated attributes that are created at class initialization time, instead of being generated through the Movie class build_index_object() function.

This is both kind of a minor bug, but also something that should be documented.

cjcodeproj commented 3 months ago

Commit:

https://github.com/cjcodeproj/medialibrary/commit/ccea7931cd542e0920bd5f9ac8dacffb628ecab7

cjcodeproj commented 3 months ago

Second commit: (mostly style/lint fixes):

https://github.com/cjcodeproj/medialibrary/commit/855ac1d33578d1833e811675a1a3d950750ffe7d