[RELEASE] Random and last items smartplaylist script for Skins

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Martijn Online
Team-XBMC
Posts: 7,714
Joined: Jul 2011
Reputation: 115
Location: Dawn of time
Post: #161
mikebzh44 Wrote:Here is a video of my HTPC (Atom N330) with Glass skin.

My script is called 4 times in parallel and evertthing is OK within a minut Frown.

Maybe using the commoncache module can speed some things up. Like keeping cached data of the json request for an hour or longer

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first


For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
sdaconceicao Offline
Junior Member
Posts: 20
Joined: Nov 2010
Reputation: 0
Post: #162
Martijn Wrote:So what do you expect when running several addons at a time?

Especialy when using mysql, large library and probably a slow HTPC. Don't think that anything can be done about that
I'm not sure what your attitude is for, I'm just commenting on a performance issue I ran into. To give an idea on my machine, it's a Pentium Dual Core, 8 GB ram, and 1 GB GPU, so it's not a Tandy as you're suggesting.

The normal recently added scripts for tv shows takes about 10 seconds to run, so I don't think it's unreasonable to say 45 minutes for less episodes would seem out of the ordinary and worth looking into.

I like the idea of the scripts, and I'm not making demands. I'm just mentioning a pretty significant performance issue. Feel free to ignore it.
find quote
fmronan Offline
Fan
Posts: 586
Joined: Dec 2010
Reputation: 4
Post: #163
the normal recently script read just the last 10 movie, but with playlist it must read all the database
find quote
Projectzero Offline
Junior Member
Posts: 14
Joined: Feb 2012
Reputation: 0
Post: #164
Is there a way to have the script run after certain events e.g. on xbmc startup and after a completed library update? Currently everytime you go to the main window it will run the script. This isn't terrible if you only call the script once and are hardwired to your network but more than a few calls and wireless it gets painfully slow with a large library. I completely understand that the script scans through the entire library which will lead to slowdowns but maybe this could help alleviate some of the issues?
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,067
Joined: Nov 2011
Reputation: 19
Location: Nantes - France
Post: #165
Martijn Wrote:Maybe using the commoncache module can speed some things up. Like keeping cached data of the json request for an hour or longer

I will have a closer look to commoncache but if you have set up parameters for display only unwatched movies for example, each time the script is called, I have to scan all the playlist/library to seach for unwatched movies. And what's happen when you add a new source to your library ?

Projectzero Wrote:Is there a way to have the script run after certain events e.g. on xbmc startup and after a completed library update? Currently everytime you go to the main window it will run the script. This isn't terrible if you only call the script once and are hardwired to your network but more than a few calls and wireless it gets painfully slow with a large library. I completely understand that the script scans through the entire library which will lead to slowdowns but maybe this could help alleviate some of the issues?

Maybe there is a JSON method to known if database has been updated, I will ask to the specific thread.

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

find quote
krish_2k4 Offline
Fan
Posts: 578
Joined: Aug 2010
Reputation: 9
Post: #166
Sorry a noob question

I want the script to get one movie from the IMDB Top 250.xsp but have no idea how to code it but below is what I have so far!

I think I put the "XBMC.RunScript(script.randomandlastitems,limit=1,method=Last,playlist=special://masterprofile/playlists/IMDB Top 250.xsp,menu=1)" in the wrong place! but no clue were to put it.

PHP Code:
            <!-- Featured -->
            <
control type="group">
                <
visible>Container(300).HasFocus(3)</visible>                                                        
                <
control type="list" id="370">
                    <include>
IMDB Movie</include>                    
                    <
content>
                        <
item id="1">
                            <
onload>XBMC.RunScript(script.randomandlastitems,limit=1,method=Last,playlist=special://masterprofile/playlists/IMDB Top 250.xsp,menu=1)</onload>                
                            
<thumb>$INFO[Window.Property(PlaylistRandomMovie1.1.Thumb)]</thumb>
                            <
icon>$INFO[Window.Property(PlaylistRandomMovie1.1.Fanart)]</icon>            
                            <
onclick>$INFO[Window.Property(PlaylistRandomMovie1.1.Path),PlayMedia(,)]</onclick>
                        </
item>
                    </
content>
                </
control>
            </
control>
            <!-- 
Featured (End) --> 

Confused
(This post was last modified: 2012-03-07 17:37 by krish_2k4.)
find quote
fmronan Offline
Fan
Posts: 586
Joined: Dec 2010
Reputation: 4
Post: #167
in home.xml if you want, or include.xml

<onload>XBMC.RunScript(script.randomandlastitems,limit=1, method=Last,playlist=special://masterprofile/playlists/IMDB Top 250.xsp,menu=1)</onload>

and modify

<!-- Featured -->
<control type="group">
<visible>Container(300).HasFocus(3)</visible>
<control type="list" id="370">
<include>IMDB Movie</include>
<content>
<item id="1">

<thumb>$INFO[Window.Property(PlaylistRandomMovie1.1.Thumb)]</thumb>
<icon>$INFO[Window.Property(PlaylistRandomMovie1.1.Fanart)]</icon>
<onclick>$INFO[Window.Property(PlaylistRandomMovie1.1.Path),PlayMedia(,)]</onclick>
</item>
</content>
</control>
</control>
<!-- Featured (End) -->
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,067
Joined: Nov 2011
Reputation: 19
Location: Nantes - France
Post: #168
You cannot use the script this way.

You have to use a compatible skin :
Glass : http://forum.xbmc.org/showthread.php?tid=114839
Convergence : http://forum.xbmc.org/showthread.php?tid=99839
Fusion Migma V2 : http://forum.xbmc.org/showthread.php?tid=120867

I can give your details for Glass.

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

find quote
krish_2k4 Offline
Fan
Posts: 578
Joined: Aug 2010
Reputation: 9
Post: #169
fmronan Wrote:in home.xml if you want, or include.xml

<onload>XBMC.RunScript(script.randomandlastitems,limit=1, method=Last,playlist=special://masterprofile/playlists/IMDB Top 250.xsp,menu=1)</onload>

and modify

<!-- Featured -->
<control type="group">
<visible>Container(300).HasFocus(3)</visible>
<control type="list" id="370">
<include>IMDB Movie</include>
<content>
<item id="1">

<thumb>$INFO[Window.Property(PlaylistRandomMovie1.1.Thumb)]</thumb>
<icon>$INFO[Window.Property(PlaylistRandomMovie1.1.Fanart)]</icon>
<onclick>$INFO[Window.Property(PlaylistRandomMovie1.1.Path),PlayMedia(,)]</onclick>
</item>
</content>
</control>
</control>
<!-- Featured (End) -->

this is how I have it in home.xml

mikebzh44 Wrote:You cannot use the script this way.

You have to use a compatible skin :
Glass : http://forum.xbmc.org/showthread.php?tid=114839
Convergence : http://forum.xbmc.org/showthread.php?tid=99839
Fusion Migma V2 : http://forum.xbmc.org/showthread.php?tid=120867

I can give your details for Glass.

Im trying to use the script in a skin im developing. I just want it to display 1 random movie from the IMDB Top 250.xsp on the home view.

Im just having trouble getting the script to work. But are you saying it will only work on those skins?
find quote
fmronan Offline
Fan
Posts: 586
Joined: Dec 2010
Reputation: 4
Post: #170
no you run the script in your container
find quote
Post Reply