[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,791
Joined: Nov 2011
Reputation: 48
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
BigNoid Offline
Team-Kodi Member
Posts: 3,151
Joined: Jul 2010
Reputation: 102
Location: Below sea level
Post: #182
Great, thx mikebzh44 Smile
find quote
BigNoid Offline
Team-Kodi Member
Posts: 3,151
Joined: Jul 2010
Reputation: 102
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 BigNoid.)
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,791
Joined: Nov 2011
Reputation: 48
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,684
Joined: Jun 2009
Reputation: 39
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
BigNoid Offline
Team-Kodi Member
Posts: 3,151
Joined: Jul 2010
Reputation: 102
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 Offline
Fan
Posts: 600
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
BigNoid Offline
Team-Kodi Member
Posts: 3,151
Joined: Jul 2010
Reputation: 102
Location: Below sea level
Post: #188
Yeah it should save some code Smile
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,791
Joined: Nov 2011
Reputation: 48
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
BigNoid Offline
Team-Kodi Member
Posts: 3,151
Joined: Jul 2010
Reputation: 102
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
mikebzh44 Offline
Posting Freak
Posts: 1,791
Joined: Nov 2011
Reputation: 48
Location: Nantes - France
Post: #191
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.

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

find quote
BigNoid Offline
Team-Kodi Member
Posts: 3,151
Joined: Jul 2010
Reputation: 102
Location: Below sea level
Post: #192
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)
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,791
Joined: Nov 2011
Reputation: 48
Location: Nantes - France
Post: #193
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

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

(This post was last modified: 2012-03-23 18:06 by mikebzh44.)
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,791
Joined: Nov 2011
Reputation: 48
Location: Nantes - France
Post: #194
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]

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

find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #195
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).
(This post was last modified: 2012-03-28 17:09 by spiff.)
find quote
Post Reply