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

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



Re: [RELEASE] Random and last items of video smartplaylist script for Skins - Martijn - 2013-03-27

albumidid -> albumid
I think


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-27

Sure Blush


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - MarcosQui - 2013-03-27

mikebzh44, all ok now, no more errors in the log.

Thank you.


Re: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-27

Ok so I will push a new release on github tomorrow.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-28

V2.1.1 in on GITHUB :

https://github.com/XBMC-Addons/script.randomandlastitems

- 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.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - MarcosQui - 2013-03-28

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



RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-28

Oops, sorry I have forgot to push the duration calculation is media_streamdetails function.

Can you give a try now ?

Thanks.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - MarcosQui - 2013-03-28

Everything's fine now. Thank you.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-29

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=122448&pid=1381406#pid1381406

So Art(poster) and Art(thumb) available for movies.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - Martijn - 2013-03-29

(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


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - phil65 - 2013-03-29

(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^^


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-29

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=160540&pid=1378513#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 ?


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - phil65 - 2013-03-29

(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=160540&pid=1378513#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.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins - mikebzh44 - 2013-03-29

I hear it loud and clear Wink


RE: [RELEASE] Random and last items smartplaylist script for Skins - Venares - 2013-03-30

(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.