Kodi Community Forum

Full Version: [RELEASE] RandomItems (Random Items) Script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Superseded by the Skin Widgets Addon post 4th Oct 2012.

Based on Nuka1195's RecentlyAdded script.

Uses -
  • Alternative to Recently Added items (ie Welo's 'Random Items')
  • Additional to Recently Added items (ie Fusion's 'Featured Items')


Parameters (separated by &) -

PHP Code:
limit=#         ; # to limit returned results (default=5)
unplayed=True   True to return only items (not supported for albumsthat have not been played (default=False)
trailer=True    True to play the trailer (if available) (default=False)
alarm=#         ; # number of minutes before running again (default=Off) 

For example -

PHP Code:
XBMC.RunScript(script.randomitems,limit=10&unplayed=True&alarm=30

will return 10 random, unplayed movies, episodes and songs every 30 minutes.


Labels -

PHP Code:
"RandomMovie.%d.Title"
"RandomMovie.%d.Rating"
"RandomMovie.%d.Year"
"RandomMovie.%d.Plot"
"RandomMovie.%d.RunningTime"
"RandomMovie.%d.Path"
"RandomMovie.%d.Trailer"
"RandomMovie.%d.Fanart"
"RandomMovie.%d.Thumb"
"RandomMovie.Count" 

PHP Code:
"RandomEpisode.%d.ShowTitle"
"RandomEpisode.%d.EpisodeTitle"
"RandomEpisode.%d.EpisodeNo"
"RandomEpisode.%d.EpisodeSeason"
"RandomEpisode.%d.EpisodeNumber"
"RandomEpisode.%d.Plot"
"RandomEpisode.%d.Rating"
"RandomEpisode.%d.Path"
"RandomEpisode.%d.Fanart"
"RandomEpisode.%d.Thumb"
"RandomEpisode.Count" 


PHP Code:
"RandomMusicVideo.%d.Title"
"RandomMusicVideo.%d.Year"
"RandomMusicVideo.%d.Plot"
"RandomMusicVideo.%d.RunningTime"
"RandomMusicVideo.%d.Path"
"RandomMusicVideo.%d.Artist"
"RandomMusicVideo.%d.Fanart"
"RandomMusicVideo.%d.Thumb"
"RandomMusicVideo.Count" 

PHP Code:
"RandomAlbum.%d.Title"
"RandomAlbum.%d.Year"
"RandomAlbum.%d.Artist"
"RandomAlbum.%d.Path"
"RandomAlbum.%d.Fanart"
"RandomAlbum.%d.Thumb"
"RandomAlbum.%d.Rating"
"RandomAlbum.Count" 

PHP Code:
"RandomSong.%d.Title"
"RandomSong.%d.Year"
"RandomSong.%d.Artist"
"RandomSong.%d.Album"
"RandomSong.%d.Path"
"RandomSong.%d.Fanart"
"RandomSong.%d.Thumb"
"RandomSong.%d.Rating"
"RandomSong.Count" 

PHP Code:
"RandomAddon.%d.Name"
"RandomAddon.%d.Author"
"RandomAddon.%d.Summary"
"RandomAddon.%d.Version"
"RandomAddon.%d.Path"
"RandomAddon.%d.Type"
"RandomAddon.%d.Fanart"
"RandomAddon.%d.Thumb"
"RandomAddon.Count" 

Download:
XBMC EDEN: http://mirrors.xbmc.org/addons/eden-pre/...ndomitems/
Frodo Nightly Builds: https://github.com/XBMC-Addons/script.ra.../downloads

IF YOU HAVE ANY ISSUES, ALWAYS INCLUDE A FULL Debug Log WITH YOUR REPORT

Thanks to ppic and ronie for all the updates.
I'm just getting the same 3 movies while testing this out?

At the moment I'm running it in startup.xml, also have run it as that 8999 button -
PHP Code:
<control type="button" id="10">
            <
description>trigger</description>
            <
onfocus>ReplaceWindow(Home)</onfocus>
            <
onfocus>XBMC.RunScript(script.randomitems,limit=10&amp;unplayed=True)</onfocus>
            <
texturenofocus>-</texturenofocus>
            <
texturefocus>-</texturefocus>
    </
control

And this is the property fields:

Quote:<label>$INFO[Window.Property(RandomMovie.1.Title)]</label>
<label>$INFO[Window.Property(RandomMovie.2.Title)]</label>
Etc..

Am I missing something?
i only tested it briefly a while ago and had the same issue.
furthermore, random episodes did not work for me...they all returned empty.

random songs worked fine though.
Sorry guys, I forgot to mention you need &amp;random=True because I couldn't work out how to set it to 'true' as default - I know next to nothing about Python.

If anyone knows how to fix this then please let me know and I'll get it updated.
For systems that run all the time, is there a way to make this run every 24 hours?
i don't understand what the problem is ?
can you explain, if i catch it, i'll take a look Wink
ppic Wrote:i don't understand what the problem is ?
can you explain, if i catch it, i'll take a look Wink

I must be retarded or something, did I ask a dumb question. lol

I was just wondering since some people leave their HTPC on all the time, was it possible to make the script run every 24 hours without them having to shutdown xbmc. I have it running in startup.xml.
I think he was talking about my problem with making it default to true so we don't have to add 'random=True' to the parameters.

For your problem you could use the 'AlarmClock' function.
Hitcher Wrote:I think he was talking about my problem with making it default to true so we don't have to add 'random=True' to the parameters.

For your problem you could use the 'AlarmClock' function.

Such as:

<onfocus>AlarmClock(Random,XBMC.RunScript(script.randomitems,limit=10&amp;unplayed=True&amp;random=True),24:00[,silent])</onfocus>
ho ok !!!

so hitcher, you want random=True if not specified in parameter ?
so still allow to pass random=False if you don't want random
ppic Wrote:ho ok !!!

so hitcher, you want random=True if not specified in parameter ?
so still allow to pass random=False if you don't want random
As it's for random items only I'd like to remove the need to add anything.

Thanks.
ha !!!
ok !!!

should be easy so far, i'll check that and keep you in touch Wink
Works perfectly, thanks.

If you have the time do you think you could implement the alarm function that was used in the RecentlyAdded script that would help igotdvds to set a 24 hour check?

Cheers.
well i don't know this function, i'll try and see
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23