[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,768
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #61
Did you have the same issue with playlists stored in special://profile/playlists/video/ ?

Can you send me your email by MP, I cannot post attachments Sad

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

find quote
mikebzh44 Offline
Posting Freak
Posts: 1,768
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #62
Or can you simply edit randomandlastitems.py and add the line in bold :

Code:
if PLAYLIST == "":
        PLAYLIST = "videodb://1/2/"
    json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "video", "properties": ["year", "runtime", "file", "playcount", "rating", "plot", "fanart", "thumbnail", "resume", "trailer"]}, "id": 1}' %(PLAYLIST))
    json_query = unicode(json_query, 'utf-8', errors='ignore')
    json_pl_response = simplejson.loads(json_query)
    [b]print("JSON_PL_RESPONSE=",json_pl_response)[/b]

and give me the log file.

Thanks.

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

find quote
mad-max Online
Posting Freak
Posts: 1,479
Joined: Jul 2010
Reputation: 57
Location: Germany
Post: #63
mikebzh44 Wrote:Or can you simply edit randomandlastitems.py and add the line in bold :

Code:
if PLAYLIST == "":
        PLAYLIST = "videodb://1/2/"
    json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "video", "properties": ["year", "runtime", "file", "playcount", "rating", "plot", "fanart", "thumbnail", "resume", "trailer"]}, "id": 1}' %(PLAYLIST))
    json_query = unicode(json_query, 'utf-8', errors='ignore')
    json_pl_response = simplejson.loads(json_query)
    [b]print("JSON_PL_RESPONSE=",json_pl_response)[/b]

and give me the log file.

Thanks.

here you go:
Code:
15:23:08 T:5016 WARNING: CUtil::GetMatchingSource... no matching source found for ['special://masterprofile/playlists/video/Dokumentationen.xsp']
15:23:08 T:5016 WARNING: Previous line repeats 4 times.
15:23:08 T:5016 WARNING: XFILE::CFactoryDirectory::Create - Unsupported protocol('special) in 'special://masterprofile/playlists/video/Dokumentationen.xsp'
15:23:08 T:5016  NOTICE: ('JSON_PL_RESPONSE=', {u'jsonrpc': u'2.0', u'id': 1, u'error': {u'message': u'Invalid params.', u'code': -32602}})
15:23:08 T:5016   ERROR: Error Type: <type 'exceptions.KeyError'>
15:23:08 T:5016   ERROR: Error Contents: ('result',)
15:23:08 T:5016   ERROR: Traceback (most recent call last):
                                              File "C:\Users\max\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlast​items.py", line 181, in <module>
                                                _getMovies()
                                              File "C:\Users\max\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlast​items.py", line 50, in _getMovies
                                                if (json_pl_response['result'] != None) and (json_pl_response['result'].has_key("files")):
                                            KeyError: ('result',)
15:23:08 T:4576   ERROR: CRemoteControl::Connect - failed to connect
15:23:19 T:2324   ERROR: Control 1 in window 10099 has been asked to focus, but it can't

Thanks!

mad-max

[Image: obi3o55x.jpg]
[Image: 7c8w3bu8.png]

- - - Tribute to Metallica - - -

If I managed to help you, please click my reputation
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,768
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #64
Could you test with this calling (without ' before and after each parameter value):

Code:
<onload>XBMC.RunScript(script.randomandlastitems,limit=3,method=Last,playlist=special​://skin/playlists/HDMovies.xsp,menu=Menu1)</onload>

On my PC, I've got the same error as you if I put '

Maybe I have to handle this case and remove it when parsing parameters.

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

find quote
mad-max Online
Posting Freak
Posts: 1,479
Joined: Jul 2010
Reputation: 57
Location: Germany
Post: #65
mikebzh44 Wrote:Could you test with this calling (without ' before and after each parameter value):

Code:
<onload>XBMC.RunScript(script.randomandlastitems,limit=3,method=Last,playlist=special​://skin/playlists/HDMovies.xsp,menu=Menu1)</onload>

On my PC, I've got the same error as you if I put '

Maybe I have to handle this case and remove it when parsing parameters.

That did the trick...Now it works like a charm...
Thanks!

BTW and a bit OT: I recoded the GUI.ViewInstaller Window from 1080i to 720p...if you are interested, I can send you the xml...

mm

[Image: obi3o55x.jpg]
[Image: 7c8w3bu8.png]

- - - Tribute to Metallica - - -

If I managed to help you, please click my reputation
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,768
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #66
mad-max Wrote:That did the trick...Now it works like a charm...
Thanks!

BTW and a bit OT: I recoded the GUI.ViewInstaller Window from 1080i to 720p...if you are interested, I can send you the xml...

mm
For the ', I will try to manage it in the script.

For your GUI windows, send it me by email (send by PM)

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

find quote
shaktoo Offline
Posting Freak
Posts: 845
Joined: Mar 2010
Reputation: 6
Location: Surrey
Post: #67
hello mikebzh44, its a wonderful script, unfortunately I am having trouble running it. here is the pastebin
http://pastebin.com/uJiwQW1B
Iam on windows 7x64, Eden 3b, tried in Glass & Aeon Nox
Would appreciate any help
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,768
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #68
Hello.

I think that you shouldn't put PlayMedia when setting playlist=

Right way is :

playlist=special://profile/playlists/videos/Bollywood Hollywood.xsp

Sent from my mobile with tapatalk.

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

find quote
mad-max Online
Posting Freak
Posts: 1,479
Joined: Jul 2010
Reputation: 57
Location: Germany
Post: #69
mikebzh44 Wrote:Sent from my mobile with tapatalk.



LaughLaughLaugh

[Image: obi3o55x.jpg]
[Image: 7c8w3bu8.png]

- - - Tribute to Metallica - - -

If I managed to help you, please click my reputation
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,768
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #70
It's not funny.

My father in law (father of my wife) doesn't have Internet and I have to spend all my week-end in his house Sad

Sent from my mobile with tapatalk.

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

find quote
mad-max Online
Posting Freak
Posts: 1,479
Joined: Jul 2010
Reputation: 57
Location: Germany
Post: #71
No Internet is hard, but since when does forum.xbmc.org support tapatalk?
That's why I laughed...

Thought you were joking...

mm

[Image: obi3o55x.jpg]
[Image: 7c8w3bu8.png]

- - - Tribute to Metallica - - -

If I managed to help you, please click my reputation
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,768
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #72
You're all right Wink

No tapatalk for forum.xbmc.org Sad

Sent from my Galaxy S Tongue

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

find quote
shaktoo Offline
Posting Freak
Posts: 845
Joined: Mar 2010
Reputation: 6
Location: Surrey
Post: #73
mikebzh44, could you please elaborate on the setting playlist part , i looked and found the playmedia reference and deleted it but It did not do anything, the playlists are working properly otherwise and I am not sure why this isnt working for me.. could yourself or anyone else please guide me how to.. will be much appreciated .. Thanks
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,768
Joined: Nov 2011
Reputation: 47
Location: Nantes - France
Post: #74
Shaktoo, are you a skinner and do you want to add my script to your skin ?

Or are you only a XBMC user ?

If you are a skinner, you should call my script this way :

XBMC.RunScript(script.randomandlastitems,playlist=special://profile/playlists/video/Bollywood Hollywood.xsp,method=Last,menu=Menu1)

And use the properties returned :

PlaylistLastMovieMenu1.Count
PlaylistLastMovieMenu1.1.Title
PlaylistLastMovieMenu1.2.Title

as describe in the README.txt

If you are only a user, you have to use a skin that can handle my script. The only one I know is Glass but you have to install version 112 or higher.

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

find quote
Martijn Offline
Team Kodi
Posts: 11,436
Joined: Jul 2011
Reputation: 165
Location: Dawn of time
Post: #75
Add skin 'Aeon Nox' to the list SVN/Git version.

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
Post Reply