XBMC Community Forum
[RELEASE] Random and last items smartplaylist script for Skins - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Skin Development (/forumdisplay.php?fid=12)
+--- Thread: [RELEASE] Random and last items smartplaylist script for Skins (/showthread.php?tid=122448)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - mikebzh44 - 2012-03-21 15:33

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


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Big_Noid - 2012-03-21 21:44

Great, thx mikebzh44 Smile


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Big_Noid - 2012-03-23 09:29

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 ();



RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - mikebzh44 - 2012-03-23 12:38

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


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Mudislander - 2012-03-23 13:00

(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]



RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Big_Noid - 2012-03-23 13:19

(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.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - fmronan - 2012-03-23 13:20

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>



RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Big_Noid - 2012-03-23 13:44

Yeah it should save some code Smile


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - mikebzh44 - 2012-03-23 13:53

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.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Big_Noid - 2012-03-23 17:21

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.