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-29

Version 1.1.9 released

v1.1.9
- [Fix] If video has no stream details, resolution is set to blank

Has this script is still in development and I will add random and last properties for music, I think I won't put it on official repository, because of point 6.1 :

http://wiki.xbmc.org/index.php?title=Official_add-on_repository#Updates


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

Out of interest, if you use the property "propertie=SomePlayList" and do not set "type", is there anyway you could get if the type is Movie or Episode from the script. This makes a difference for me as the resulting list for Movies are shown as portrait while Episodes are landscape


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

Could you explain more, I don't understand your remark Sad


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

(2012-04-01, 12:31)mikebzh44 Wrote: Could you explain more, I don't understand your remark Sad

I've been redoing support for this script and have used

Code:
XBMC.RunScript(script.randomandlastitems,playlist=SomePlayList,method=Last,limit=10,unwatched=False,resume=False,propertie=MyFirstPlaylist)

And not added the option "type = Movie/Episode" so that type will be read from playlist file. Which works and is easier.

But when I want to display the output I now need to know if the playlist (Added by a user) was for Movie/Episode as they are displayed differently

Is there anyway I can get from the script what "type" (Movie/Episode) the playlist of " propertie=MyFirstPlaylist" is


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

No, but I can return a new property Type.

I'm busy today but I will make it for tomorrow Wink


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

@Mudislander :

If you want to test the new property Type, you just have to edit randomandlastitems.py code in the addon directory :

before :
Code:
def _setGeneralProperties ( _total, _watched, _unwatched ):
    global PROPERTIE
    global WINDOW
    # Set window properties
    _setProperty ( "%s.Count" % ( PROPERTIE ), str( _total ) )
    _setProperty ( "%s.Watched" % ( PROPERTIE ), str( _watched ) )
    _setProperty ( "%s.Unwatched" % ( PROPERTIE ), str( _unwatched ) )

After :
Code:
def _setGeneralProperties ( _total, _watched, _unwatched ):
    global PROPERTIE
    global WINDOW
    global TYPE
    # Set window properties
    _setProperty ( "%s.Count" % ( PROPERTIE ), str( _total ) )
    _setProperty ( "%s.Watched" % ( PROPERTIE ), str( _watched ) )
    _setProperty ( "%s.Unwatched" % ( PROPERTIE ), str( _unwatched ) )
    _setProperty ( "%s.Type" % ( PROPERTIE ), TYPE )



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

(2012-04-02, 10:42)mikebzh44 Wrote: @Mudislander :

If you want to test the new property Type, you just have to edit randomandlastitems.py code in the addon directory :

Thanks Big Grin I'll give it a test


Edit Initial test, seems to work well, have cut out miles of code Smile




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

Found a small bug for you with the .Count property. Not an issue for me but you may want to look at it.

I have a playlist that returns 20 items, with 2 watched and 18 Unwatched - Which is correct. When I tell the script I only want to see the Unwatched items it returns 18 which is correct. However the .Count property stays at 20, with 2 watched and 18 Unwatched. Should it not now report 18 items with 0 watched.

As I said not an issue for me, as I'm happy it's reporting back on the whole playlist but you can decide what you want Smile


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

It's because .Count, .Watched and .Unwatched are based on Playlist and not on options resume= or unwatched=.

So everything is OK Wink

Has your tests are OK, I will put .Type property in next version.


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

All good, looking forward to next update, .Type property is a big help - Thanks


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

Hope this won't affect the old way.


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

No. You can specifie all the properties if you want.


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

Great thanx, btw just integrated your work in cirrus extended v2 and cirrus extended light.

See Here


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

Great work and great skins.


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

Version 1.2.0 released

v1.2.0
- [Add] Property .Type is returned. Value is Movie or Episode.
Helpfull if you use script with playlist and did not specifie type= parameter so script will get type from playlist.