Closed n1ck3 closed 11 years ago
After taking a look at this again, I remember what the issue is here. The subsonic API version 1.8.0 introduced a number of new methods that operate on the ID3 tags vs. the old way of a simple directory structure. If you used the id number with the getMusicDirectory() method, you should end up getting the results you want. So, this would work:
c = Connection('https://music.example.com' , 'user' , 'password')
s = c.search2('tribe called quest' , 1 , 0 , 0 , 0 , 0)
json.dumps(c.getMusicDirectory(ret['searchResult2']['artist']['id']) ,
sort_keys=True , indent=2)
I'm currently updating the documentation at https://stuffivelearned.org/doku.php?id=programming:python:py-sonic with all the 1.8.0 API version items, but until I'm done a pydoc libsonic.connection will show you basically the same thing. Anything that has a reference to "using ID3 tags" will not be compatible with the older methods of using the simple directory structure. I'm going to make a note of that on the aforementioned documentation page as well as even I had completely forgotten about that.
To use the getArtist(), getAlbum(), etc. You would probably want to start with a getArtists() call and manually search for what you want to display.
Oh, I should have also mentioned that search3() will return results by ID3 tag.
I've update the documentation at https://stuffivelearned.org/doku.php?id=programming:python:py-sonic with the API 1.8.0 docs as well as a specific warning about mixing methods: https://stuffivelearned.org/doku.php?id=programming:python:py-sonic
Using:
The album IDs obtained from earching for albums and the looking at the albums in the results of getArtist() seem to correspond with the ones in the Subsonic web interface. However, they cannot be used for getAlbum().
When I do a getSong(), the artist and album IDs returned are different and the ones that can be used with getArtist() and getAlbum().
This small python script demonstrates the issue:
$ ./test.py