[RELEASE] Random and last items smartplaylist script for Skins

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
mr.sparkle Offline
Fan
Posts: 433
Joined: Dec 2009
Reputation: 2
Post: #736
I'm using 2.2.2 with Helix/Aeon Shednox 4.1.9.9 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
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,842
Joined: Nov 2011
Reputation: 50
Location: Nantes - France
Post: #737
The smart playlist manager have nothing to do with this addon.

I think it's a skin issue.

Sorry for my english, but, you know, I'm French so ...

find quote
tomer953 Offline
Senior Member
Posts: 167
Joined: Mar 2010
Reputation: 3
Post: #738
This is still working?
Created smartplaylist Tomer.xsp :
Code:
<smartplaylist type="movies">
    <name>Tomer</name>
    <match>all</match>
    <rule field="year" operator="is">
        <value>2013</value>
    </rule>
</smartplaylist>

put this on startup.xml
Code:
<onload>RunScript(script.randomandlastitems,limit=10,method=Last,playlist=special://masterprofile/playlists/video/Tomer.xsp,menu=Menu1)</onload>

using this label:
Code:
$INFO[Window(Home).Property(PlaylistLastMovieMenu1.1.Title)]
or
$INFO[Window(Home).Property(PlaylistLast.MovieMenu1.1.Title)]
or
$INFO[Window(Home).Property(Menu1.1.Title)]

cant get nothing...
Helix
find quote
schimi2k Offline
Senior Member
Posts: 209
Joined: Nov 2011
Reputation: 8
Location: Germany
Post: #739
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<--
                                             - 
NOTEIGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            
Error Type: <type 'exceptions.RuntimeError'>
                                            
Error Contentsaccess_violation
                                            Traceback 
(most recent call last):
                                              
File "C:\Users\schimi2k\AppData\Roaming\Kodi\addons\script.randomandlastitems\randoman​dlastitems.py"line 852in <module>
                                                
_getEpisodesFromPlaylist()
                                              
File "C:\Users\schimi2k\AppData\Roaming\Kodi\addons\script.randomandlastitems\randoman​dlastitems.py"line 429in _getEpisodesFromPlaylist
                                                _setEpisodeProperties 
_episode_count )
                                              
File "C:\Users\schimi2k\AppData\Roaming\Kodi\addons\script.randomandlastitems\randoman​dlastitems.py"line 619in _setEpisodeProperties
                                                _json_query 
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodeDetails", "params": {"properties": ["streamdetails"], "episodeid":%s }, "id": 1}' %(_episode['id']))
                                            
RuntimeErroraccess_violation
                                            
-->End of Python script error report<-- 

maybe u have an idea ?
thx in advance mate
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,842
Joined: Nov 2011
Reputation: 50
Location: Nantes - France
Post: #740
@Tomer :

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

Code:
RunScript(script.randomandlastitems,type=Movie,playlist=special://profile/playlists/video/Cartoons.xsp,method=Last,limit=10,unwatched=False,resume=False,property=SmartPla​ylist1)

and how properties are used in skin :

Code:
<label>$INFO[Window(Home).Property(SmartPlaylist1.1.Title)]</label>

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 :

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

BEFORE :

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

AFTER :

Code:
_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

Sorry for my english, but, you know, I'm French so ...

find quote
tomer953 Offline
Senior Member
Posts: 167
Joined: Mar 2010
Reputation: 3
Post: #741
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):

[Image: pDKSiPv.png]

Here is the startup.xml -> copied from your message (only changed Cartoons to Tomer):
http://pastebin.com/79zELm2c
[Image: 7meeii4.png]

and here is the label control in "View-Fanart.xml":
http://pastebin.com/DRUxkUCG
[Image: dfRuKQq.png]

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:
http://pastebin.com/5J1SLpym
and I found in google this table: http://www.utf8-chartable.de/unicode-utf...ng-literal

any ideas?

etc, the libary is Mysql libary
(This post was last modified: 2015-01-22 14:04 by tomer953.)
find quote
senna99 Offline
Fan
Posts: 437
Joined: Sep 2011
Reputation: 3
Location: Novi Sad Yugoslavia
Post: #742
Hello

Small help.

Is it possible to call pvr channels with script.randomandlastitems in home menu to present name of channels and icon
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,842
Joined: Nov 2011
Reputation: 50
Location: Nantes - France
Post: #743
I don't know, "\xe2\x80\x8b" : ZERO WIDTH SPACE

http://utf8-chartable.de/unicode-utf8-ta...ng-literal

Maybe a wrong copy/paste.

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

[Image: 1505][Image: 1493][Image: 1507]

http://www.charbase.com/05e1-unicode-heb...ter-samekh
http://www.charbase.com/05d5-unicode-hebrew-letter-vav
http://www.charbase.com/05e3-unicode-heb...r-final-pe

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

Sorry for my english, but, you know, I'm French so ...

(This post was last modified: 2015-01-22 14:06 by mikebzh44.)
find quote
tomer953 Offline
Senior Member
Posts: 167
Joined: Mar 2010
Reputation: 3
Post: #744
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 :]
(This post was last modified: 2015-01-22 14:12 by tomer953.)
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,842
Joined: Nov 2011
Reputation: 50
Location: Nantes - France
Post: #745
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

Sorry for my english, but, you know, I'm French so ...

find quote
Post Reply