[RELEASE] Random and last items smartplaylist script for Skins

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Martijn Offline
Team-XBMC
Posts: 10,254
Joined: Jul 2011
Reputation: 153
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
BigNoid Offline
Team-XBMC Member
Posts: 2,923
Joined: Jul 2010
Reputation: 90
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,557
Joined: Nov 2011
Reputation: 39
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,557
Joined: Nov 2011
Reputation: 39
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,557
Joined: Nov 2011
Reputation: 39
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,557
Joined: Nov 2011
Reputation: 39
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,557
Joined: Nov 2011
Reputation: 39
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 Offline
Posting Freak
Posts: 778
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,557
Joined: Nov 2011
Reputation: 39
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
BigNoid Offline
Team-XBMC Member
Posts: 2,923
Joined: Jul 2010
Reputation: 90
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
Eisi2005 Offline
Fan
Posts: 693
Joined: Feb 2011
Reputation: 1
Location: Germany
Post: #41
@mikebzh44

sorry found my mistake.

Greets
Eisi
(This post was last modified: 2012-02-14 21:14 by Eisi2005.)
find quote
Eisi2005 Offline
Fan
Posts: 693
Joined: Feb 2011
Reputation: 1
Location: Germany
Post: #42
@mikebzh44

could you make a counter for the playlist. For movie library there is a counter how many movies are in library howmay are watched and how many are unwatched ?

Is there a chance to make this for a playlist ?

Greets
Eisi
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,557
Joined: Nov 2011
Reputation: 39
Location: Nantes - France
Post: #43
For the first one, "How many movies in the library/playlist" is stored in propertie :

Playlist<method>Movie<menu>.Count

(See first post or README.txt in ZIP file for details).

For the 2 others counter, I can do that but script will be slower to return results because I will have to scan every movie of the library/playlist and test if it's watched or not.

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

find quote
Eisi2005 Offline
Fan
Posts: 693
Joined: Feb 2011
Reputation: 1
Location: Germany
Post: #44
Hi,

if you have time for this, give it a try Smile

I hope you know the widget that i mean for movie library.

Greets
Eisi
find quote
BigNoid Offline
Team-XBMC Member
Posts: 2,923
Joined: Jul 2010
Reputation: 90
Location: Below sea level
Post: #45
mikebzh44 Wrote:For the 2 others counter, I can do that but script will be slower to return results because I will have to scan every movie of the library/playlist and test if it's watched or not.

Don't you already fetch playcount to filter watched/unwatched and resumed items? The script wouldn't run slower then if the option unwatched=true is set?
find quote
Post Reply