Closed cjcodeproj closed 3 months ago
The problem lies with the equality test with the Movie
class.
It's comparing the unique_key
values of both objects, which are probably identical. So, the clobbering is only taking place between two objects when one of them is a member of the Movie class.
The issue actually only was noticeable if one of the content objects was a Movie object, because the Movie
class is the one that had the equality check operator.
The object still has __lt__
and __gt__
operators which will get removed soon.
See there related tickets:
https://github.com/cjcodeproj/medialibrary/issues/148 https://github.com/cjcodeproj/medialibrary/issues/172
The
Repo
code has a content array that looks like this.https://github.com/cjcodeproj/medialibrary/blob/f37e074d29e6ecdb38942ca38e92663f5176b7df/src/media/fileops/repo.py#L46-L52
And it adds content to the
contents
array like this.https://github.com/cjcodeproj/medialibrary/blob/f37e074d29e6ecdb38942ca38e92663f5176b7df/src/media/fileops/repo.py#L87-L91
But if two disparate pieces of content share the same title, then the second content object will go missing, even if that content object is a different class.
I noticed this when I tried to load both the movie "Moonraker" and the soundtrack "Moonraker".