[RELEASE] Random and last items smartplaylist script for Skins

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Martijn Online
Team-XBMC
Posts: 7,694
Joined: Jul 2011
Reputation: 114
Location: Dawn of time
Post: #31
If you do this script will benefit from a speeds increase on processing.
PHP Code:
# Use json instead of simplejson when python v2.7 or greater
if sys.version_info < (27):
    
import json as simplejson
else:
    
import simplejson 

I also noticed that when you have several buttons with playlists next to each other it takes some time to update them. So if you switch to the next one you will get the list for a couple of seconds of the previous playlist.
Don't know if this is something you can solve?

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first


For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
Big_Noid Offline
Skilled Skinner
Posts: 2,626
Joined: Jul 2010
Reputation: 68
Location: Below sea level
Post: #32
Can you make the Count property count all the movies in the playlist regardless of unwatched option, just like in random movies script and recent added script?
Right now it counts the number of items returned by the script, instead of the playlist items.
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,049
Joined: Nov 2011
Reputation: 18
Location: Nantes - France
Post: #33
Martijn Wrote:If you do this script will benefit from a speeds increase on processing.
PHP Code:
# Use json instead of simplejson when python v2.7 or greater
if sys.version_info < (27):
    
import json as simplejson
else:
    
import simplejson 

I also noticed that when you have several buttons with playlists next to each other it takes some time to update them. So if you switch to the next one you will get the list for a couple of seconds of the previous playlist.
Don't know if this is something you can solve?
Thanks for the tip.

For the second problem, I don't know if I could do something Frown

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

find quote
mikebzh44 Offline
Posting Freak
Posts: 1,049
Joined: Nov 2011
Reputation: 18
Location: Nantes - France
Post: #34
Big_Noid Wrote:Can you make the Count property count all the movies in the playlist regardless of unwatched option, just like in random movies script and recent added script?
Right now it counts the number of items returned by the script, instead of the playlist items.
I will ask to fmronan, Glass skinner, because the script has been made with him and for him.

Maybe, I could return a new propertie like TotalCount.

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

find quote
mikebzh44 Offline
Posting Freak
Posts: 1,049
Joined: Nov 2011
Reputation: 18
Location: Nantes - France
Post: #35
buges Wrote:Im having problems with the script loading my playlist. The playlist is there in xbmc & working perfectly.

Im using a hidden button to run:
"<onfocus>XBMC.RunScript(script.RandomAndLastItems,limit=10,method='Last',playlist='spe​cial://profile/playlists/video/1234.xsp','menu=Menu1')</onfocus>"

But I just get an error

Debug gives me:
"WARNING: CUtil::GetMatchingSource... no matching source found for ['special://profile/playlists/video/1234.xsp']"
"WARNING: XFILE::CFactoryDirectory::Create - Unsupported protocol('special) in 'special://profile/playlists/video/1234.xsp'"

Am i doing something stupidly wrong?

I have the same warning as you but script is OK and properties are displayed.

But I think you have made a mistake in your code :
<onfocus>XBMC.RunScript(script.RandomAndLastItems,limit=10,method='Last',playlist='spe​cial://profile/playlists/video/1234.xsp','menu=Menu1')</onfocus>

Right code should be :
<onfocus>XBMC.RunScript(script.RandomAndLastItems,limit=10,method='Last',playlist='spe​cial://profile/playlists/video/1234.xsp',menu='Menu1')</onfocus>

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

find quote
mikebzh44 Offline
Posting Freak
Posts: 1,049
Joined: Nov 2011
Reputation: 18
Location: Nantes - France
Post: #36
For the warning, it's normal : http://forum.xbmc.org/showpost.php?p=101...count=1703

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

find quote
mikebzh44 Offline
Posting Freak
Posts: 1,049
Joined: Nov 2011
Reputation: 18
Location: Nantes - France
Post: #37
New version 1.0.4 : http://passion-xbmc.org/addons/Download....-1.0.4.zip

Fix a bug and now, propertie Count contains the number of movies in the playlist.

I have to think about Watched and Unwatched because I have to scan every movies of the playlist to see if playcount =0 or not.

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

find quote
Shinu Online
Posting Freak
Posts: 769
Joined: Jul 2010
Reputation: 3
Location: Trinidad &amp; Tobago
Post: #38
once u get things sorted out for movies, will u be looking into tv shows too?

PS: u should update ur first post with the link to the latest version. i could have sworn that u were still on version 1.0.1.

[Image: sigpic_71695_ea6badd43f8af70382024c3e138d01b9.jpg]
[Image: watched-fanart.jpg]
[Image: widget]
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,049
Joined: Nov 2011
Reputation: 18
Location: Nantes - France
Post: #39
First post has been updated Wink

Newt step is TV Shows

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

find quote
Big_Noid Offline
Skilled Skinner
Posts: 2,626
Joined: Jul 2010
Reputation: 68
Location: Below sea level
Post: #40
mikebzh44 Wrote:Fix a bug and now, propertie Count contains the number of movies in the playlist.

Great, thx!
find quote
Post Reply