I wanted to make the experience seamless with the skin as a whole, so the code to launch the script is coded directly into the skin (rather than launching through the addons menu).
I therefore thought I'd share the code with other skin developers so that they could include with their skins if they wanted to.
Script id: script.randommovie
Compatibility: Dharma (see below)
Source: https://github.com/elParaguayo/xbmc-random-movies
Download (Dharma): https://github.com/elParaguayo/xbmc-rand...all/master
Download (pre-Eden): https://github.com/elParaguayo/xbmc-rand...ll/preEden
Skin code:
Up to the skinner as to where to include the code. The key lines are:
For filter by genre:
Code:
<onclick>RunScript(script.randommovie, filtergenre=True)</onclick>
<visible>System.HasAddon(script.randommovie)</visible>For no genre filter:
Code:
<onclick>RunScript(script.randommovie)</onclick>
<visible>System.HasAddon(script.randommovie)</visible>The user is first asked (via a yes/no dialog) whether they want to restrict the choice to unwatched movies. If the genre filter has been delected then the list of genres populates a DialogSelect list.
As I understand it, this isn't compatible in post-Dharma versions - I assume this is down to the deprecation of the http api requests and their replacement with JSON RPC calls.
Once I get pre-Eden working on my laptop I'll convert the script. EDIT: DONE.
I hope someone else finds this useful.
el_P
EDIT: Please note, there is a more comprehensive Random Items script (available here) which you may want to consider looking at. Depends what your needs are!

Search
Help