[RELEASE] Random and last items smartplaylist script for Skins

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
mikebzh44 Offline
Posting Freak
Posts: 1,062
Joined: Nov 2011
Reputation: 19
Location: Nantes - France
Post: #181
Version 1.1.6 released

As Big_Noid asked, script can get playlist type by reading playlist file.

So you can call the script this way :

Code:
XBMC.RunScript(script.RandomAndLastItems,limit=10,method=Random,playl​ist=specia​l://masterprofile/playlists/video/children.xsp,menu=Menu1)

As my playlist children.xsp is a movie playlist, script will set properties PlaylistRandomMovieMenu1

With a tvshows or episodes playlist, properties are PlaylistRandomEpisodeMenu1.

Caution : If you don't set up playlist= parameter to work on library, you HAVE TO set up type= parameter

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

find quote
Big_Noid Online
Skilled Skinner
Posts: 2,627
Joined: Jul 2010
Reputation: 68
Location: Below sea level
Post: #182
Great, thx mikebzh44 Smile
find quote
Big_Noid Online
Skilled Skinner
Posts: 2,627
Joined: Jul 2010
Reputation: 68
Location: Below sea level
Post: #183
Removing type= from the script variable does not work for me. If i adjust the script with this and fill type=Auto in the script parameters all works fine:
Code:
if TYPE == 'Auto' and PLAYLIST != '':
   _getPlaylistType ();
(This post was last modified: 2012-03-23 09:29 by Big_Noid.)
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,062
Joined: Nov 2011
Reputation: 19
Location: Nantes - France
Post: #184
It"s very strange as in Glass, I can call the script this way :

Quote:XBMC.RunScript(script.randomandlastitems, playlist=$INFO[Skin.String(Menu_Men1_Recently_play)], method=$INFO[Skin.String(Widget1_Men1)], limit=10, unwatched=False, resume=False, propertie=PlaylistLastMovieMen1)
So with providing playlist= and omitting type= everything work fine Confused

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

(This post was last modified: 2012-03-23 12:39 by mikebzh44.)
find quote
Mudislander Offline
Skilled Skinner
Posts: 1,155
Joined: Jun 2009
Reputation: 20
Post: #185
(2012-03-23 12:38)mikebzh44 Wrote:  It"s very strange as in Glass, I can call the script this way :

Quote:XBMC.RunScript(script.randomandlastitems, playlist=$INFO[Skin.String(Menu_Men1_Recently_play)], method=$INFO[Skin.String(Widget1_Men1)], limit=10, unwatched=False, resume=False, propertie=PlaylistLastMovieMen1)
So with providing playlist= and omitting type= everything work fine Confused

Find for me that it still works better including the variable "type" also easier to find the list for display in widget. Below is TV Episodes working in Convergence with "Ali Later" playlist totals.

[Image: tvplaylist.png]

Noli illegitimi carborundum
find quote
Big_Noid Online
Skilled Skinner
Posts: 2,627
Joined: Jul 2010
Reputation: 68
Location: Below sea level
Post: #186
(2012-03-23 12:38)mikebzh44 Wrote:  It"s very strange as in Glass, I can call the script this way :

Quote:XBMC.RunScript(script.randomandlastitems, playlist=$INFO[Skin.String(Menu_Men1_Recently_play)], method=$INFO[Skin.String(Widget1_Men1)], limit=10, unwatched=False, resume=False, propertie=PlaylistLastMovieMen1)
So with providing playlist= and omitting type= everything work fine Confused

Adding propertie= makes it work. Didn't see that was mandatory.
find quote
fmronan Online
Fan
Posts: 584
Joined: Dec 2010
Reputation: 4
Post: #187
me I use
Code:
<onload condition ="Skin.HasSetting(homepageHideRecentlyMen1Added)">XBMC.RunScript(script.randomandlastitems,playlist=$INFO[Skin.String(Menu_Men1_Recently_play)],method=$INFO[Skin.String(Widget1_Men1)],limit=10,unwatched=False,resume=False,type=$INFO[Skin.String(Widget1_Type_Men1)],propertie=PlaylistLastMovieMen1)</onload>

with property you can call your list like you want
Code:
<onload condition ="Skin.HasSetting(homepageHideRecentlyMen1Added)">XBMC.RunScript(script.randomandlastitems,playlist=$INFO[Skin.String(Menu_Men1_Recently_play)],method=$INFO[Skin.String(Widget1_Men1)],limit=10,unwatched=False,resume=False,type=$INFO[Skin.String(Widget1_Type_Men1)],propertie=MyFirstPlaylist)</onload>
and you have

Code:
<item id="1">
                <label>$INFO[Window(Home).Property(MyFirstPlaylist.1.Title)]</label>
                <label2>-</label2>
                <onclick>PlayMedia($INFO[Window(Home).Property(MyFirstPlaylist.1.Path)])</onclick>
                <icon>$INFO[Window(Home).Property(MyFirstPlaylist.1.Thumb)]</icon>
                <thumb>$INFO[Window(Home).Property(MyFirstPlaylist.1.Fanart)]</thumb>
                <property name="MoviePlot">$INFO[Window(Home).Property(MyFirstPlaylist.1.Plot)]</property>
                <property name="MovieYear">$INFO[Window(Home).Property(MyFirstPlaylist.1.Year)]</property>
                <property name="MovieRating">$INFO[Window(Home).Property(MyFirstPlaylist.1.Rating)]</property>
                <property name="RunningTime">$INFO[Window(Home).Property(MyFirstPlaylist.1.RunningTime)]</property>
                <property name="Path">$INFO[Window(Home).Property(MyFirstPlaylist.1.RootPath)]</property>
                <property name="Case">$VAR[VideoMovieMovieCase1,ClearCase/,.png]</property>
            </item>
(This post was last modified: 2012-03-23 13:27 by fmronan.)
find quote
Big_Noid Online
Skilled Skinner
Posts: 2,627
Joined: Jul 2010
Reputation: 68
Location: Below sea level
Post: #188
Yeah it should save some code Smile
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,062
Joined: Nov 2011
Reputation: 19
Location: Nantes - France
Post: #189
Properties name was the problem.

In the script, if propertie= is not set (awfull mistake : 1 property, 2 properties Blush) properties name is make off PlaylistMethodTypeMenu but Type is unknown at this moment.

Glass have no problem because propertie is set to get always the same name even if Method or Type change.

I will fix it on next version.

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

find quote
Big_Noid Online
Skilled Skinner
Posts: 2,627
Joined: Jul 2010
Reputation: 68
Location: Below sea level
Post: #190
That propertie= is real nice. And with the automatic playlist detection there only are a few lines to run the script. Very nice Smile
Now when can we expect a push to official repo Big Grin I want to add it as a dependency in my skin before I submit it to the repo.
find quote
Post Reply