Kodi Community Forum
[RELEASE] Random and last items smartplaylist script for Skins - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Skin Development (/forumdisplay.php?fid=12)
+--- Thread: [RELEASE] Random and last items smartplaylist script for Skins (/showthread.php?tid=122448)



- fmronan - 2012-02-19 23:40

Yes great workNod


- mad-max - 2012-02-19 23:51

Modded Confluence can handle this, too...
Currently predefined for documentary, but custom entry will follow tomorrow...

Cheers,
mad-max


- shaktoo - 2012-02-20 00:06

mikebzh44 Wrote:Shaktoo, are you a skinner and do you want to add my script to your skin ?
Only In My Dreams !!Laugh
Just a user !


- mikebzh44 - 2012-02-20 09:38

So you have to use Glass SVN or Modded Confluence.

I don't know Modded Confluence but Glass let you define custom menus and you can activate for each one my script to display random items or last added items.

Do you want a little How-to ?


- shaktoo - 2012-02-20 13:43

mike I have already tried it in Glass SVN and Nox Git ( which utilises the script) in glass I have configured it and i Can see the widget but it remains empty and dosent show anything , unfortunately in Nox home screen dosent even shows the widgets , its as if the skin isnt even calling the script


- shaktoo - 2012-02-20 13:44

I'll post a few screens when I get back home to explain further


- mikebzh44 - 2012-02-20 14:28

Which version of Glass ? I'm running v112.

In the Glass directory skin.glass.svn, could you open includes.xml and search for :

Code:
randomanlastitems

If you have :
Code:
unwatched=True
or
Code:
resume=True

Please change to :
Code:
unwatched=False
or
Code:
resume=False

In Glass settings, did you have done this :

System > Skin
Menu customizer
Customize Menu 1
Set label and playlist

Home window options
Show recently added items
Set same playlist as above for customized menu
Show Random items
Set same playlist as above for customized menu


- Thizizmyname - 2012-02-21 15:19

shaktoo Wrote:mike I have already tried it in Glass SVN and Nox Git ( which utilises the script) in glass I have configured it and i Can see the widget but it remains empty and dosent show anything , unfortunately in Nox home screen dosent even shows the widgets , its as if the skin isnt even calling the script

I have a similar problem with modded confluense right now.
I just made this logfile for that skin but since its about this script and it seems to be on two different skins I'll post this here aswell.

http://pastebin.com/nZcMZ5bT

The error show up here:
Code:
14:06:24 T:3600   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "special://masterprofile/playlists/video/custom1.xsp", "media": "video", "properties": ["year", "runtime", "file", "playcount", "rating", "plot", "fanart", "thumbnail", "resume", "trailer"]}, "id": 1}
14:06:24 T:3600   DEBUG: JSONRPC: Calling files.getdirectory
14:06:24 T:3600 WARNING: CUtil::GetMatchingSource... no matching source found for [special://masterprofile/playlists/video/custom1.xsp]
14:06:24 T:3600 WARNING: Previous line repeats 4 times.
14:06:24 T:3600   ERROR: Error loading Smart playlist special://masterprofile/playlists/video/custom1.xsp (failed to read file)
14:06:24 T:3600   ERROR: Previous line repeats 1 times.
14:06:24 T:3600   ERROR: XFILE::CDirectory::GetDirectory - Error getting special://masterprofile/playlists/video/custom1.xsp
14:06:24 T:3600  NOTICE: [RandomAndLastItems] ## PLAYLIST special://masterprofile/playlists/video/custom1.xsp COULD NOT BE LOADED ##
14:06:24 T:3600  NOTICE: ('[RandomAndLastItems] JSON RESULT ', {u'jsonrpc': u'2.0', u'id': 1, u'error': {u'message': u'Invalid params.', u'code': -32602}})
14:06:24 T:3600    INFO: Scriptresult: Success
14:06:24 T:3600    INFO: Python script stopped

EDIT: Now looking at the code, my playlist isn't "custom1.xsp" its "AppData\Roaming\XBMC\userdata\playlists\video\film.xsp"
custom1 is the custom homebutton I have placed "film.xsp" in. changing the playlists filename to custom1 made it work.


- mikebzh44 - 2012-02-21 15:24

Your playlist custom1 has been created and you browse it ?

Because in the log, you can see :

Code:
14:06:24 T:3600   ERROR: Error loading Smart playlist special://masterprofile/playlists/video/custom1.xsp (failed to read file)
14:06:24 T:3600   ERROR: XFILE::CDirectory::GetDirectory - Error getting special://masterprofile/playlists/video/custom1.xsp

For me, it's not a script issue but a skin issue.


- mad-max - 2012-02-21 15:50

mikebzh44 Wrote:Your playlist custom1 has been created and you browse it ?

Because in the log, you can see :

Code:
14:06:24 T:3600   ERROR: Error loading Smart playlist special://masterprofile/playlists/video/custom1.xsp (failed to read file)
14:06:24 T:3600   ERROR: XFILE::CDirectory::GetDirectory - Error getting special://masterprofile/playlists/video/custom1.xsp

For me, it's not a script issue but a skin issue.

Already solved...
His playlist was named "fi lm" and not "custom1"...
Your script is working fine! Awesome work...

BTW&OT: Saw some small issues with viewtype installer in 720p...
Will fix them and then send you the file

cheers,
mad-max


- mikebzh44 - 2012-02-21 15:53

Good news.

New version will provide some cool extra features Wink


- mad-max - 2012-02-21 15:56

mikebzh44 Wrote:New version will provide some cool extra features Wink

Can't wait for it Wink


- fmronan - 2012-02-21 16:04

Yes you can , I finish to add everything in Glass, beforeLaugh


- mad-max - 2012-02-21 16:58

fmronan Wrote:Yes you can , I finish to add everything in Glass, beforeLaugh

Haha...this is definetly NOT funny... Laugh


- fmronan - 2012-02-21 18:35

I think especially since we do not have the same humor.
However, this also allows most testing to be done before offering you the script