SoCo/SoCo — pull request #93 by KennethNielsen (2014-03-03 22:06:15+00:00)
Title: Wimp plugin part 1

Hallo everyone

(After a few fixes and a regretted initial PR) ... here's part 1 of the first music service plugin for SoCo, for the Wimp music service. The PR also contains the first version of the music service data structures, which can be used by other music services as well.

Since I have written the data structures using just a single service, there will probably be things that needs to be made more general, but that will be discovered when the second music service shows up.

The plugin implements get_x (x being tracks, albums etc) methods comparable to these found in core for the music library. The search results can be added to the queue by the core add_to_queue method, just like music library items.

So to use it you can do something like:
``` python
from soco.plugins.wimp import Wimp
import soco
soc = soco.SoCo(ip)
wimp = Wimp(soc, your_user_id)
tracks = wimp.get_tracks('Minerva')
soc.add_to_queue(tracks[0])
```

NOTE: The music service artist items cannot be played. It seems to also be the case with my other music service. Therefore, they cannot at present be added to the queue. They can however (probably) be browsed, to ultimately yield playable items, but that is for part 2.

Being now a little bit more knowledgeable about the data structures I was also able to simplify the inheritance quite a bit. What is missing now, as mentioned above, are methods to tell whether an instance can be en-queued, browsed or neither.

If you happen to look the code over, but are not able to test, because you do not have access to this service, please write so in a comment, because I would rather not be waiting for testing that might not show up.