Kodi Community Forum

Full Version: [RELEASE] Random and last items smartplaylist script for Skins
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
albumidid -> albumid
I think
Sure Blush
mikebzh44, all ok now, no more errors in the log.

Thank you.
Ok so I will push a new release on github tomorrow.
V2.1.1 in on GITHUB :

https://github.com/XBMC-Addons/script.ra...dlastitems

- Fix runtime property to use duration from streamdetails

Because I use Files.GetDirectory JSON function to get movie informations, runtime returned field is not overwrite with streamdetails(video(duration)) returned field, instead of VideoLibrary.GetMovies used by service.skin.widgets.
So now, runtime property is based on duration field and if duration is not set, runtime field is used.

- Fix play property for albums

Thanks to MarcosQui, play property for albums was broken in the last release.

- Add art(thumb) for movies (same value as art(poster) but easiest for skinner to deal with albums and movies smart playlists)

As Martijn have ported this script to Frodo, he also use the same property names. So Art(poster) cas set for movies and Art(thumb) was set for albums. But for custom menus, widgets and backgrounds, skinners have to know if smart playlist is based on albums or movies to use the right property. Now, skinners can use Art(thumb) in any case.
mikebzh44, in this version I get a new error:

Code:
10:35:14 T:5480   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.KeyError'>
Error Contents: ('duration',)
Traceback (most recent call last):
File "C:\Users\Marcos\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 701, in <module>
_getMovies()
File "C:\Users\Marcos\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 162, in _getMovies
if streaminfo['duration'] != 0:
KeyError: ('duration',)
-->End of Python script error report<--
Oops, sorry I have forgot to push the duration calculation is media_streamdetails function.

Can you give a try now ?

Thanks.
Everything's fine now. Thank you.
Quote:To all skinners :

Property Art(poster) for movies is deprecated, use Art(thumb) instead. Will be remove soon Wink

Sorry missunderstund : http://forum.xbmc.org/showthread.php?tid...pid1381406

So Art(poster) and Art(thumb) available for movies.
(2013-03-29, 11:06)mikebzh44 Wrote: [ -> ]To all skinners :

Property Art(poster) for movies is deprecated, use Art(thumb) instead. Will be remove soon Wink

why?
this is the default used in Frodo i would definitely keep this. iirc thumb is something we want te deprecate in some future versions of xbmc
(2013-03-29, 11:06)mikebzh44 Wrote: [ -> ]To all skinners :

Property Art(poster) for movies is deprecated, use Art(thumb) instead. Will be remove soon Wink

you probably misunderstoood something^^
I think so Blush

So before putting this script upside down :

Art(poster) was returned for movies

Art(thumb) was returned for albums

But Live CD Cases background was broken in Aeon Nox for custom menu based on albums smart playlists because XML use Art(poster) even for music playlist :

http://forum.xbmc.org/showthread.php?tid...pid1378513

So what are the right properties this script should return to make everybody happy ??

Art(poster) for movies and for albums ?

Remove Art(thumb) for albums ?
(2013-03-29, 12:17)mikebzh44 Wrote: [ -> ]I think so Blush

So before putting this script upside down :

Art(poster) was returned for movies

Art(thumb) was returned for albums

But Live CD Cases background was broken in Aeon Nox for custom menu based on albums smart playlists because XML use Art(poster) even for music playlist :

http://forum.xbmc.org/showthread.php?tid...pid1378513

So what are the right properties this script should return to make everybody happy ??

Art(poster) for movies and for albums ?

Remove Art(thumb) for albums ?

Only add Art(thumb) for movies because it can save skinners some code. no changes to the rest.
I hear it loud and clear Wink
(2013-01-10, 17:51)mikebzh44 Wrote: [ -> ]Fixed for TVShows playlist.

I'm at my office and I can't use github to push my fix so you just have to edit randomandlastitems.py file and go to line 238 :

before
Code:
# Add TV Show fanart and thumbnail for each episode
#_episode["tvshowid"]=_file['id']
art = _episode['art']
_episode["tvshowfanart"]=art.get('tvshow.fanart')
_episode["tvshowthumb"]=art.get('thumb')

after
Code:
# Add TV Show fanart and thumbnail for each episode
#_episode["tvshowid"]=_file['id']
art = _episode['art']
# Add episode ID when playlist type is TVShow
_episode["id"]=_episode['episodeid']
_episode["tvshowfanart"]=art.get('tvshow.fanart')
_episode["tvshowthumb"]=art.get('thumb')

@Martijn : could you push this fix on github and on repo ? Thanks.

mikebzh44, seems the latest commit broke this again.
Again, using the two playlists trick with one set to episode works around the issue.