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

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Skin Development (/forumdisplay.php?fid=12)
+--- Thread: [RELEASE] Random and last items smartplaylist script for Skins (/showthread.php?tid=122448)



- Big_Noid - 2012-02-15 19:19

All good now Smile


- Martijn - 2012-02-15 23:01

Got an error with latest script:
http://paste.ubuntu.com/843519/

EDIT:
Happened because I emptied my library and the playlists still exist


- mikebzh44 - 2012-02-16 00:23

Martijn Wrote:Got an error with latest script:
http://paste.ubuntu.com/843519/

EDIT:
Happened because I emptied my library and the playlists still exist
I love when user solve the problem by himself Laugh


- Martijn - 2012-02-16 00:30

mikebzh44 Wrote:I love when user solve the problem by himself Laugh

Didn't say i fixed it. Just gave you on how to reproduce Cool
The exception should still be caught by the script Wink

Because when you have a certain smartplaylist with some rules you can get an empty list


- fmronan - 2012-02-16 00:34

we know, that's for tommorowRolleyes


- mikebzh44 - 2012-02-16 09:55

Martijn Wrote:Didn't say i fixed it. Just gave you on how to reproduce Cool
The exception should still be caught by the script Wink

Because when you have a certain smartplaylist with some rules you can get an empty list
Sure.

Bad news, filtering on partially watched movies will be disable on the next version because of a bug in the JSONRPC API :

http://forum.xbmc.org/showpost.php?p=1019599&postcount=1715


- mikebzh44 - 2012-02-16 11:02

Version 1.0.6 released

- [Fix] Handle exception when playlist is empty or fetching information failed
- resume= parameter is disable because of a bug in method GetDirectory of JSONRPC API

For resume= option, if method GetDirectory in JSONRPC API couldn't be fixed, I can work around this problem by making a single request for each movie in the playlist/library, but script will be slower Confused


- Big_Noid - 2012-02-16 11:17

We can use the watchlist script for resumed movies. Imo it's better to have a fast script.


- mikebzh44 - 2012-02-16 11:22

Yes but watchlist script will not work on playlist. So you won't be able to display a widget showing partially watched movie in playlist Kids as example.

I can make extra request for each movie only if resume is set to True. So script will run as fast as now when resume is set to False.

Because, I don't known if JSONRPC API will be modified : http://forum.xbmc.org/showpost.php?p=1019634&postcount=1716


- mad-max - 2012-02-16 14:31

I have some issues with latest version 1.06...

My onload command:

Code:
<onload>XBMC.RunScript(script.randomandlastitems,limit=3,method='Last',playlist='spec​ial://skin/playlists/HDMovies.xsp',menu='Menu1')</onload>

Error in Log:

Code:
13:18:28 T:528  NOTICE: -->Python Interpreter Initialized<--
13:18:28 T:528 WARNING: CUtil::GetMatchingSource... no matching source found for ['special://skin/playlists/HDMovies.xsp']
13:18:28 T:528 WARNING: Previous line repeats 4 times.
13:18:28 T:528 WARNING: XFILE::CFactoryDirectory::Create - Unsupported protocol('special) in 'special://skin/playlists/HDMovies.xsp'
13:18:28 T:528   ERROR: Error Type: <type 'exceptions.KeyError'>
13:18:28 T:528   ERROR: Error Contents: ('result',)
13:18:28 T:528   ERROR: Traceback (most recent call last):
                                              File "C:\Users\max\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlast​items.py", line 180, in <module>
                                                _getMovies()
                                              File "C:\Users\max\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlast​items.py", line 49, in _getMovies
                                                if (json_pl_response['result'] != None) and (json_pl_response['result'].has_key("files")):
                                            KeyError: ('result',)
13:18:30 T:4784   ERROR: Control 1 in window 10099 has been asked to focus, but it can't

Running Beta 3 on Win 7...

Any hint?

cheers,
mad-max