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

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300)
+---- Thread: [RELEASE] Random and last items smartplaylist script for Skins (/showthread.php?tid=122448)



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

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=special://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 - BigNoid - 2012-03-21

Great, thx mikebzh44 Smile


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

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

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 :S


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

(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 :S

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



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

(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 :S

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

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 - BigNoid - 2012-03-23

Yeah it should save some code Smile


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

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 - BigNoid - 2012-03-23

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.


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

Did you use Count, Watched and Unwatched properties ?

fmronan have lost those properties in Glass and I wonder if it's due to my last version.

As soon as fmronan get back those properties, I will push the script to official repo.


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

They work fine with version 1.1.6.
I use this to run the script:
Code:
XBMC.RunScript(script.randomandlastitems, playlist=$INFO[Skin.String(HomeMenuVideoPlaylist1_Path)], method=$INFO[Skin.String(MethodVPL1)], limit=10, unwatched=$INFO[Skin.String(IncludeWatchedCVPL)], resume=False, propertie=PlaylistLastMovieVPL1)



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

Yes, fmronan have found the problem in Glass (some code lost when including Artwork Downloader addon).

I will post version 1.1.7 on Ciné-passion repo to fix properties name and if no bugs found I will push it to official repo monday morning.
Version 1.1.7 released

v1.1.7
- [Fix] When type= was not set with playlist, properties name was unwellformed


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

Version 1.1.8 released

v1.1.8
- [Add] New property Resolution for Movies. Values are blank, 480, 540, 576, 720, 1080

[Off Topic]
I was thinking about skinners who want to put this script as a require in their skin. I thought that you could put a require on passion-xbmc repository and then a require on my script. But passion-xbmc repository can't be added to official repository Sad
Someone from the XBMC team (Martijn ?) can explain why ?
It could be a great promotion for passion-XBMC repository and users can discover some new addons.
[/Off Topic]


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

because it's a third party repository and we want to make it absolute 110% clear by you having to add it manually.

if you want your add-ons officially "embraced", they need to be under our control (in terms of what is distributed from xbmc.org).