Kodi Community Forum
[RELEASE] Random and last items smartplaylist script for Skins - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300)
+---- Thread: [RELEASE] Random and last items smartplaylist script for Skins (/showthread.php?tid=122448)



RE: [RELEASE] Random and last items of video smartplaylist script for Skins - Martijn - 2013-03-26

^^jep that should do it


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-26

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.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-26

Marcos, could you send me your smart playlist XSP file and your MyMusicXX.db ?


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - phil65 - 2013-03-26

probably an empty album?


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - MarcosQui - 2013-03-26

@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.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-26

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).


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - MarcosQui - 2013-03-26

Sent to your email.

Thank you.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-26

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.randomandlastitems

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, ...) ?


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - MarcosQui - 2013-03-26

Well, then I'm certainly doing something wrong. You can use the current Ace, the error is the same at Ace or MQ 4.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-27

Hi Marcos.

Using Ace skin and latest github release for randomandlastitems script :

https://github.com/XBMC-Addons/script.randomandlastitems/archive/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.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - MarcosQui - 2013-03-27

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?


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-27

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 ?


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - MarcosQui - 2013-03-27

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<--



Re: [RELEASE] Random and last items of video smartplaylist script for Skins - Martijn - 2013-03-27

Thats an empty album id so it's not properly parsed somewhere


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-27

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.