SoCo/SoCo — pull request #191 by KennethNielsen (2014-07-02 20:55:27+00:00)
Title: Ml from didl class

This PR updates the ML classes and the mechanism for getting the ML class from the XML that we get e.g. from the search services.

The data_structures.get_ml_item module function has been updated, to now get the correct class based on DIDL class (that way it should always have been), instead on the parent ID.

The ML classes has been update to make the DIDL class a class variable, since it should be the same for all of them, and to make the parent ID a normal information item (since it really can take all sorts of values, which I didn't realize to begin with). This update break the API for ALL ML classes, since arguments in their __init__ method has changed. This is regrettable, but unavoidable and probably not too much of a problem, since I doubt many users instantiate them directly.

With this change there is now an almost one-to-one correspondence between ML structures and DIDL-classes, with the one exception being that there are two playlists, because we can also get the Sonos playlists, which is as it should be.

The core.SoCo.get_music_library_information method has been updated to take use of this, so if he search is for Sonos playlists this class is chosen directly, but in all other cases the class is found automatically by get_ml_item.

This change also lays the ground work for the browse-an-ml-structure method that has been discussed.

Let me know what you think.