Kodi Community Forum

Full Version: [RELEASE] Random and last items smartplaylist script for Skins
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
^^jep that should do it
Yes, moving down this line inside if block will remove error (and I will push this mod to github) but AudioLibrary.GetSongs function should return result for a given albumid.
Marcos, could you send me your smart playlist XSP file and your MyMusicXX.db ?
probably an empty album?
@mikebzh44, I have this:

Code:
12:54:58 T:3376   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.IndentationError'>
Error Contents: ('unexpected indent', ('C:\\Users\\Marcos\\AppData\\Roaming\\XBMC\\addons\\script.randomandlastitems\\randomandlastitems.py', 367, 4, '\t\t\t\tprint("##### SONGS=", _json_pl_response)\n'))
IndentationError: ('unexpected indent', ('C:\\Users\\Marcos\\AppData\\Roaming\\XBMC\\addons\\script.randomandlastitems\\randomandlastitems.py', 367, 4, '\t\t\t\tprint("##### SONGS=", _json_pl_response)\n'))
-->End of Python script error report<--


With Phil's solution:

Code:
13:06:06 T:5132   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.IndentationError'>
Error Contents: ('unindent does not match any outer indentation level', ('C:\\Users\\Marcos\\AppData\\Roaming\\XBMC\\addons\\script.randomandlastitems\\randomandlastitems.py', 370, 70, " _albumpath = os.path.split(_result[0]['file'])[0]\n"))
IndentationError: ('unindent does not match any outer indentation level', ('C:\\Users\\Marcos\\AppData\\Roaming\\XBMC\\addons\\script.randomandlastitems\\randomandlastitems.py', 370, 70, "_albumpath = os.path.split(_result[0]['file'])[0]\n"))
-->End of Python script error report<--

I can access the playlist correctly, the only error is in fact the main menu.
Because my script is indented with space and not tabs (\t) so replace special character tab to 4 spaces and script will run.

Send me your XSP file and MyMusic ??.db by mail (I send it by PM).
Sent to your email.

Thank you.
With your XSP file and your Music database, running Aeon Nox 4.1.7 and randomandlastitem script from GITHUB :

https://github.com/XBMC-Addons/script.ra...dlastitems

https://github.com/BigNoid/Aeon-Nox

Everything work fine (except pictures because I don't have your cache folders) :

Image

Statistics are good too : 7 artists / 9 albums / 119 songs in your database

How did you call my script in Aeon MQ4 ?

Is there a way to download your Aeon MQ4 development release (github / google code / ZIP on MediaFire, ...) ?
Well, then I'm certainly doing something wrong. You can use the current Ace, the error is the same at Ace or MQ 4.
Hi Marcos.

Using Ace skin and latest github release for randomandlastitems script :

https://github.com/XBMC-Addons/script.ra...master.zip

And everything is OK, no error in log file.

The only thing wrong is that you albumr "Sade - The best of" have no songs in the database you send me.
mikebzh44 with this version a part of the problem has been resolved, I have no more error when entering the main menu, but still can not play an album by clicking on the widget, I believe I need to adjust the command in the skin but I am in doubt.

For movies I use this: (works fine)

<onclick>$INFO[Window(0).Property(PlaylistLastMovieMenuxx.1.Play)]</onclick>


For Album I use this: (I get error)

<onclick>$INFO[Window(0).Property(PlaylistLastMusicMenuxx.1.Play)]</onclick>


I tried to use exactly as described in documentation: (nothing happens)

<onclick>$INFO[Window(0).Property(LastAlbumMenuxx.1.Play)]</onclick>

Is that correct?

PS. The album requested is in FLAC and is rather large, +450 MB. Do you really need him?
No, no need of your album. I just say that in your XBMC database, the album "Best Of" from Sade is empty (no songs) :

This album get id 9 :

Image

But there is no songs attached to albumId = 9 :

Image

For playing the selected album, what is the error in the log ?
Code:
Error Type: <type 'exceptions.ValueError'>
Error Contents: invalid literal for int() with base 10: 'None'
Traceback (most recent call last):
File "C:\Users\Marcos\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 692, in <module>
_parse_argv()
File "C:\Users\Marcos\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 581, in _parse_argv
xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "albumid": %d } }, "id": 1 }' % int(params.get("albumid")))
ValueError: invalid literal for int() with base 10: 'None'
-->End of Python script error report<--
Thats an empty album id so it's not properly parsed somewhere
No, it's my fault.

Edit line 543 and 544 and change 'id' to 'albumid'

Code:
play = 'XBMC.RunScript(' + __addonid__ + ',albumid=' + str(_album.get('albumid')) + ')'
path = 'musicdb://3/' + str(_album.get('albumidid')) + '/'

Save and test.

If it's OK, I will push the fix on GITHUB.