2012-01-29, 23:21
the script was tested and optimized, you have to see if you can add it in the next update of the script.
http://glass.googlecode.com/files/RandomItems.py
thank you
![Nod Nod](https://forum.kodi.tv/images/smilies/yes4lo.gif)
thank you
fmronan Wrote:the script was tested and optimized, you have to see if you can add it in the next update of the script.bad file ronanhttp://glass.googlecode.com/files/RandomItems.py
thank you
FrostBox Wrote:bad file ronan
this is good zip http://code.google.com/p/glass/downloads...p&can=2&q=
try: import json # Use speedup
except: import simplejson as json # No speed
Martijn Wrote:So json is faster as simplejson?json uses a binary lib to speed things up, so yeah it's faster.
Martijn Wrote:Will you need to make much changes to the coding to use it that way?
import simplejson
try: import json as simplejson
except: import simplejson
ronie Wrote:change:
to:Code:import simplejson
Code:try: import json as simplejson
except: import simplejson
ronie Wrote:since i really would like to avoid the file existence checks (which would cause my drives to spin up each time the script runs),
wouldn't it be possible to check for the cached thumb instead?
- changed: [addon info] file existence checks for "fnmatch - Unix filename pattern matching"
- changed/added: setting param 'extraimages=True' to retrieve extra images for episode (Warning: possible hard drive spin up on check existence)
RunScript(script.randomitems,limit=10&unplayed=True&alarm=30&extraimages=True)
- updated README.txt
Martijn Wrote:maybe add season banners as well when you're at it.
FrostBox Wrote:hi,well, if you use xbmcvfs.exists(), it has to spin up the drive to check if the file exists :-)
my drives no spin up, but ok I look this week...
root@xbmc:/home/xbmc# hdparm -C /dev/sdb
/dev/sdb:
drive state is: standby
root@xbmc:/home/xbmc# hdparm -C /dev/sdb
/dev/sdb:
drive state is: active/idle
FrostBox Wrote:for me, this function "self._fetch_song_info()" is not good. jsonrpc freeze xbmc 2 seconds, because I have 3000 songs. :p
FrostBox Wrote:for a moment, I added params to get extra images "extraimages=True" default False and removed file existence checks in addons info
quebert Wrote:stupid question, but is there any way I could map a button on my remote to launch this? Eden Beta 3 here if that matters.
<button>RunScript(addon.id)</button>
mad-max Wrote:mad-maxCode:<button>RunScript(addon.id)</button>
PlayMedia("$INFO[Window.Property(RandomMovie.1.Path)]")