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.
I'm using 2.2.2 with Helix/Aeon Shednox on a firetv. When using the smart playlist manager to add latest widgets and random backgrounds for smart playlists, I have to drill to the absolute path of the playlists. The "special://" notation doesn't appear. As such, the widgets don't get populated, although no error shows on screen.

I noticed in the changelog that there was a fix for Gotham special:// paths, is the same required for Helix?

Thanks in advance
The smart playlist manager have nothing to do with this addon.

I think it's a skin issue.
This is still working?
Created smartplaylist Tomer.xsp :
<smartplaylist type="movies">
    <rule field="year" operator="is">

put this on startup.xml

using this label:

cant get nothing...
hey buddy Smile Thx for this script, but i have some problems with FC´s after i come back to main menu after i navigate through the menus
Skin: latest Shednox mod
Script: 2.2.2 ( latest from repo )

here is the error from log:

PHP Code:
ERROREXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
Error Type: <type 'exceptions.RuntimeError'>
Error Contentsaccess_violation
(most recent call last):
File "C:\Users\schimi2k\AppData\Roaming\Kodi\addons\script.randomandlastitems\randomandlastitems.py"line 852in <module>
File "C:\Users\schimi2k\AppData\Roaming\Kodi\addons\script.randomandlastitems\randomandlastitems.py"line 429in _getEpisodesFromPlaylist
_episode_count )
File "C:\Users\schimi2k\AppData\Roaming\Kodi\addons\script.randomandlastitems\randomandlastitems.py"line 619in _setEpisodeProperties
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodeDetails", "params": {"properties": ["streamdetails"], "episodeid":%s }, "id": 1}' %(_episode['id']))
-->End of Python script error report<-- 

maybe u have an idea ?
thx in advance mate
@tomer :

This is how the script is called in Aeon Nox (Shedrock for Helix) :


and how properties are used in skin :


It's easier to use property= parameter in order to specifie property name and not to let script used default one.

But with "menu=Menu1" instead of "property=" parameter, properties returned are :

11:45:28 T:6932  NOTICE: ('PlaylistLastMovieMenu1.1.Title', u'La l\xe9gende de Manolo')
11:45:28 T:6932  NOTICE: ('PlaylistLastMovieMenu1.2.Title', u'Planes 2')
11:45:29 T:6932  NOTICE: ('PlaylistLastMovieMenu1.3.Title', u'1001 Pattes')
11:45:29 T:6932  NOTICE: ('PlaylistLastMovieMenu1.4.Title', u'Dragons 2')
11:45:29 T:6932  NOTICE: ('PlaylistLastMovieMenu1.5.Title', u'Khumba')
11:45:29 T:6932  NOTICE: ('PlaylistLastMovieMenu1.6.Title', u'M. Peabody et Sherman : Les Voyages dans le temps')
11:45:29 T:6932  NOTICE: ('PlaylistLastMovieMenu1.7.Title', u'Monster High - Frisson, Cam\xe9ra, Action !')
11:45:29 T:6932  NOTICE: ('PlaylistLastMovieMenu1.8.Title', u'Tarzan')
11:45:29 T:6932  NOTICE: ('PlaylistLastMovieMenu1.9.Title', u'Rio 2')
11:45:29 T:6932  NOTICE: ('PlaylistLastMovieMenu1.10.Title', u'Jack et la M\xe9canique du Coeur')

So $INFO[Window(Home).Property(PlaylistLastMovieMenu1.1.Title)] should be fine.

You can add debug by duplicating line 196 in randomandlastitems.py file (in Random And Last Items addon folder) and modifing it :


_setProperty( "%s.%d.Title"           % ( PROPERTY, _count ), _movie.get('title',''))
            _setProperty( "%s.%d.OriginalTitle"   % ( PROPERTY, _count ), _movie.get('originaltitle',''))


_setProperty( "%s.%d.Title"           % ( PROPERTY, _count ), _movie.get('title',''))
            print( "%s.%d.Title"           % ( PROPERTY, _count ), _movie.get('title',''))
            _setProperty( "%s.%d.OriginalTitle"   % ( PROPERTY, _count ), _movie.get('originaltitle',''))

CAUTION : Take care of indentation, snippets are not aligned but it's due to forum display.

@schimi2k : acces_violation, wow !! I have no idea why this FC can occur Sad
mikebzh44 many thanks to you.
buy still not working.
I'll show you step by step.

Here is the smartplaylist (I made it simple for the example, only movies from 2013):


Here is the startup.xml -> copied from your message (only changed Cartoons to Tomer):

and here is the label control in "View-Fanart.xml":

Restart Kodi, Then goes to Movies Libary and I can only see: a123 b456 (without nothing in the middle).

also modified the .py script with the "print" command like you said and all I can see is those stange lines:
and I found in google this table: http://www.utf8-chartable.de/unicode-utf...ng-literal

any ideas?

etc, the libary is Mysql libary

Small help.

Is it possible to call pvr channels with script.randomandlastitems in home menu to present name of channels and icon
I don't know, "\xe2\x80\x8b" : ZERO WIDTH SPACE


Maybe a wrong copy/paste.

But as you are running Windows in hebrew, it's normal to get u'\u05e1\u05d5\u05e3' which mean :



So I think script return title and other properties in Hebrew and Kodi can't display it.

Your Kodi is set in Hebrew or England ?

(2015-01-22, 14:03)senna99 Wrote: [ -> ]Hello

Small help.

Is it possible to call pvr channels with script.randomandlastitems in home menu to present name of channels and icon
Indeed Hebrew.... any solution ?
all of the other functions in kodi works great in hebrew, all the scripts (random items\recent albums etc)
any idea how to solve it ?

ok problem solved by changing property=SmartPlaylist1 to property=smart1
which now works great and also dispay the title in hebrew correctly.
changed it because I saw in the log "'SmartPla\xe2\x80\x8bylist1.10.Title'" so I changed it to "smart1" and now its working :]
OK, I think that SmartPlaylist1 was not the problem. I think that you have an unprintable character the first time you type SmartPlaylist (bad copy/paste from this thread ?)

But if smart1 work, you can keep it Wink
Hello, i have an problem with this script.
I used it with aeon nox mania skin and a constellation with windows 8.1, mysql db, kodi 14.2 rc1 and intel nuc i5.
When i have live dvd background in combi with an smart playlist in the home menu, i get 80% cpu used.
Without the andomlastitem, the cpu used is 9%.

How many movies in library ?
How many custom menu based on smart playlist ?
I have about 30 Blu-Ray, 20 3Ds and 120 Klassic Blu-Rays...etc
In addition Comedy Series, Drama Series and dokus. (About 120 Series - over 5000 Episodes)
Complete i have 4 custom menus for Blu-Rays and 5 custom menus for series.

The problem is, that i can only choose 5 custom smart playlists for the LiveDVD background.
(2014-10-29, 15:14)mikebzh44 Wrote: [ -> ]@skinners : Did you continue to use this script for Helix release of your skins ?

I know that a lot of skinners prefere to use plugin:// to load smart playlist and then populate widget because it's much more lighter in XML code.

The only advantage for this script is to provide stats on smart playlist (number of items, number of items watched, ...) but maybe Helix will provide this too.


Still my favourite script for a number of reasons, one being the ability to return the type of playlist being run on.

Will you be maintaining it through the Helix cycle ?
Just a quick test. I have download Kodi 15.0 Alpha 1, install Aeon Nox Shedrock and building a custom menu based on smart playlist and add LiveBG cases work great.

So maybe that this script is already "Isengard ready".