2017-01-27, 21:52
Hi pkscout,
First of all thanks very much for your add-on. I've been a user for a good while and it's excellent.
Anyway I just wanted to bring up an issue that I've recently encountered, to see if it's expected or known, and to share my workaround.
As we know, the audiodb api is currently unavailable, and since I'm using AS with streaming services (specifically I use AS with the Sonos plugin) I don't have the ability to embed musicbrainz artist IDs in my files. This had been no problem up until now, since AS did a lookup for the MBID from audiodb.
Since that's unavailable I started experimenting with adding "musicbrainz.nfo" files, containing the MBID, into the individual artist directories that the plugin creates. This wasn't working so I did some debugging...
What I noticed was that for the artist ID : 4bd95eea-b9f6-4d70-a36c-cfea77431553, the URL being generated was like this.
Notice the %0A being added after the MBID which is the escaped linefeed character. What appears to be happening is that this call at line 534
is returning the contents of the file with a "\n" at the end.
So I made an edit to the default.py adding the following at line 536 to strip this away
...and bingo everything starts working as expected. So, I'm a happy man, but aware that might just be a hack. Is this something you've come across before? It would appear that readFile() always adds the "\n" at the end in python (I'm a Java programmer by background and don't have much python experience)
Cheers,
Mark
First of all thanks very much for your add-on. I've been a user for a good while and it's excellent.
Anyway I just wanted to bring up an issue that I've recently encountered, to see if it's expected or known, and to share my workaround.
As we know, the audiodb api is currently unavailable, and since I'm using AS with streaming services (specifically I use AS with the Sonos plugin) I don't have the ability to embed musicbrainz artist IDs in my files. This had been no problem up until now, since AS did a lookup for the MBID from audiodb.
Since that's unavailable I started experimenting with adding "musicbrainz.nfo" files, containing the MBID, into the individual artist directories that the plugin creates. This wasn't working so I did some debugging...
What I noticed was that for the artist ID : 4bd95eea-b9f6-4d70-a36c-cfea77431553, the URL being generated was like this.
Code:
19:04:54.011 T:123145309356032 DEBUG: [Artist Slideshow] the url is: http://webservice.fanart.tv/v3/music/4bd95eea-b9f6-4d70-a36c-cfea77431553%0A?api_key=7a93c84fe1c9999e6f0fec206a66b0f5
Notice the %0A being added after the MBID which is the escaped linefeed character. What appears to be happening is that this call at line 534
Code:
rawdata = readFile( filename )
is returning the contents of the file with a "\n" at the end.
So I made an edit to the default.py adding the following at line 536 to strip this away
Code:
rawdata = rawdata.rstrip('\n')
...and bingo everything starts working as expected. So, I'm a happy man, but aware that might just be a hack. Is this something you've come across before? It would appear that readFile() always adds the "\n" at the end in python (I'm a Java programmer by background and don't have much python experience)
Cheers,
Mark