[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,744
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #196
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=Off...ry#Updates

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

(This post was last modified: 2012-03-29 10:17 by mikebzh44.)
find quote
Mudislander Offline
Skilled Skinner
Posts: 1,684
Joined: Jun 2009
Reputation: 39
Post: #197
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

Noli illegitimi carborundum
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,744
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #198
Could you explain more, I don't understand your remark Sad

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

find quote
Mudislander Offline
Skilled Skinner
Posts: 1,684
Joined: Jun 2009
Reputation: 39
Post: #199
(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

Noli illegitimi carborundum
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,744
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #200
No, but I can return a new property Type.

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

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

find quote
mikebzh44 Offline
Posting Freak
Posts: 1,744
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #201
@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 )

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

find quote
Mudislander Offline
Skilled Skinner
Posts: 1,684
Joined: Jun 2009
Reputation: 39
Post: #202
(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

Noli illegitimi carborundum
(This post was last modified: 2012-04-02 16:27 by Mudislander.)
find quote
Mudislander Offline
Skilled Skinner
Posts: 1,684
Joined: Jun 2009
Reputation: 39
Post: #203
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

Noli illegitimi carborundum
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,744
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #204
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.

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

find quote
Mudislander Offline
Skilled Skinner
Posts: 1,684
Joined: Jun 2009
Reputation: 39
Post: #205
All good, looking forward to next update, .Type property is a big help - Thanks

Noli illegitimi carborundum
find quote
butchabay Online
Skilled Skinner
Posts: 3,771
Joined: Mar 2010
Reputation: 74
Location: Planet Crematoria
Post: #206
Hope this won't affect the old way.
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,744
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #207
No. You can specifie all the properties if you want.

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

find quote
butchabay Online
Skilled Skinner
Posts: 3,771
Joined: Mar 2010
Reputation: 74
Location: Planet Crematoria
Post: #208
Great thanx, btw just integrated your work in cirrus extended v2 and cirrus extended light.

See Here
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,744
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #209
Great work and great skins.

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

find quote
mikebzh44 Offline
Posting Freak
Posts: 1,744
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #210
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.

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

find quote
Post Reply