Join GitHub today
Malformed model object stuctures breaks stuff, including MPD server #865
If you add add a track to the tracklist that has an an empty string for the album name, the Track instance within Mopidy has no
Steps to reproduce:
Traceback reports "AttributeError: 'dict' object has no attribute 'name'".
What is happening is that the album dict is missing the
The question is how to guard against this... We probably need to annotate our models with what types are accepted for each field and raise exceptions if the actual types doesn't match our expectations.
changed the title from
Adding malformed track to the tracklist breaks MPD 'playlist' command
Malformed model object stuctures breaks stuff, including MPD server
Sep 24, 2014
referenced this issue
Oct 9, 2014
Oh yes, I really hope so. As I can't really blame people for getting this wrong with the old APIs. Next step after this model validation fixing and more robust backend calls is likely to add type checks on core calls. And hopefully we can at least mostly trust backends to gives us the right types - though coding defensively there might not be a bad idea either.