Closed Martin-Allard closed 6 years ago
That is a recently known issue. I have added some additional error checking to the next version to skip the times when the Kodi JSONRPC returns a list as the artist name rather than a string (it's suppose to separate artists into separate entries in the JSON return, but sometimes it returns a list of names instead). The good news is that AS only uses that hash during a one time upgrade routine (for older versions of AS), so here's a workaround. We're basically going to trick AS into thinking it's already done the upgrade.
Once you do that, restart Kodi and then try again. That should bypass the problem code.
Ok thanks, I will try it when I have some time! Glad there is a work around available (and that other googlers will found this info useful!)
Hi!
For some time the AS is stuck when the script is executing. Tonight I digged a little bit and I think my issue is related to the name of some of my artist. (artist name in the form "artist1 / artist2")
The error I get in kodi.log is:
8:16:01.794 T:1428157344 ERROR: EXCEPTION: argument "path" for method "XBMCAddon::xbmc::getCacheThumbName" must be unicode or str 18:16:01.814 T:1428157344 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.TypeError'> Error Contents: argument "path" for method "XBMCAddon::xbmc::getCacheThumbName" must be unicode or str Traceback (most recent call last): File "/storage/.kodi/addons/script.artistslideshow/default.py", line 1373, in
slideshow = Main()
File "/storage/.kodi/addons/script.artistslideshow/default.py", line 175, in init
self._upgrade()
File "/storage/.kodi/addons/script.artistslideshow/default.py", line 1014, in _upgrade
self._upgrade_artist_folders()
File "/storage/.kodi/addons/script.artistslideshow/default.py", line 1042, in _upgrade_artist_folders
artist_hashes = self._upgrade_get_artists_hashmap()
File "/storage/.kodi/addons/script.artistslideshow/default.py", line 1253, in _upgrade_get_artists_hashmap
artist_hash = itemHash( artist_info['artist'] )
File "/storage/.kodi/addons/script.artistslideshow/resources/common/transforms.py", line 13, in itemHash
return xbmc.getCacheThumbName(item).replace('.tbn', '')
TypeError: argument "path" for method "XBMCAddon::xbmc::getCacheThumbName" must be unicode or str
-->End of Python script error report<--
So I opened default.py script and added the log entry "w.log( ["Get hash of %s" % (artist_info['artist'])], xbmc.LOGNOTICE )"
The result I got was this:
18:16:01.793` T:1428157344 NOTICE: [Artist Slideshow] Get hash of Emir Kusturica & The No Smoking Orchestra 18:16:01.793 T:1428157344 NOTICE: [Artist Slideshow] Get hash of Enigma 18:16:01.793 T:1428157344 NOTICE: [Artist Slideshow] Get hash of Enrico Rava 18:16:01.794 T:1428157344 NOTICE: [Artist Slideshow] Get hash of [u'Enrico Rava', u'Dino Saluzzi Quintet'] 18:16:01.794 T:1428157344 ERROR: EXCEPTION: argument "path" for method "XBMCAddon::xbmc::getCacheThumbName" must be unicode or str 18:16:01.814 T:1428157344 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.TypeError'> Error Contents: argument "path" for method "XBMCAddon::xbmc::getCacheThumbName" must be unicode or str Traceback (most recent call last): File "/storage/.kodi/addons/script.artistslideshow/default.py", line 1373, in
slideshow = Main()
File "/storage/.kodi/addons/script.artistslideshow/default.py", line 175, in init
self._upgrade()
File "/storage/.kodi/addons/script.artistslideshow/default.py", line 1014, in _upgrade
self._upgrade_artist_folders()
File "/storage/.kodi/addons/script.artistslideshow/default.py", line 1042, in _upgrade_artist_folders
artist_hashes = self._upgrade_get_artists_hashmap()
File "/storage/.kodi/addons/script.artistslideshow/default.py", line 1253, in _upgrade_get_artists_hashmap
artist_hash = itemHash( artist_info['artist'] )
File "/storage/.kodi/addons/script.artistslideshow/resources/common/transforms.py", line 13, in itemHash
return xbmc.getCacheThumbName(item).replace('.tbn', '')
TypeError: argument "path" for method "XBMCAddon::xbmc::getCacheThumbName" must be unicode or str
-->End of Python script error report<--
So the error seems to be with xbmc.executeJSONRPC returning an array when artist name is having a slash, and I presume that this part of the script does not support processing array of artist... I also checked in my music.db and I realized that the entry "Enrico Rava / Dino Saluzzi" is the first entry that use the " artist1 / artist2 ". I've got "artist1/artist2" and this does not generate error (maybe the space is important for kodi?)
Please note that I know nothing about Kodi API itself and I am very newbie with python script so I'm doing a big guess about what happening! (but I am a senior embedded programmer for more than a decade, so I'm not afraid to jump in code I don't know in language I do not know!)
If its matter, I use kodi 17.6 and the version 2.1.2 or Artist Slide Show.
I really enjoy your plugin so I hope you will find a fix for my issue!
Martin