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 / Skinners - Martijn - 2012-12-27

(2012-12-27, 14:42)mikebzh44 Wrote:
(2012-12-27, 14:00)Martijn Wrote: hmm i see "property" somehow got uppercase in the code. Will fix that.
Did change to correct spelling though Wink
propertie=H​omePlayListSeven -> property=H​omePlayListSeven
Yes, sorry for my english

One property, two properties

Nice job Martijn.

I think I can migrate from Eden / Aeon Nox 3.6.1 to Frodo / Aeon Nox 4.0 now Big Grin

Non native languages can be be difficult sometimes Wink

@Mudislander
Change (for testing)
PHP Code:
PROPERTY param.replace('PROPERTY='''
to
PHP Code:
PROPERTY param.replace('property='''



RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Mudislander - 2012-12-28

@Martijn

Okay changed the code in the script & and the label "propertie" in the skin. According to the debug log the script runs, takes upto 3 secs for a big playlist, with no erros. However I'm not able to display the results.

Would it be possible to get a script that spams the log with what it's found in the playlist (even if only for Movies) - or could you tell me how to change the script to spam the log?.

I did see you've enabled the .Art( * ) labels.

Cheers


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Martijn - 2012-12-28

Exampl
PHP Code:
for _movie in _result:
            if 
xbmc.abortRequested or _count == LIMIT:
                break
            
log(_movie
            
_count += 

This will print all data for each movie that would be added to the list.

PHP Code:
print _movie 
also works. Same principle counts for all others.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Mudislander - 2012-12-28

@Martijn - I'll have time to check the script thoroughly tomorrow but ATM it looks like the script option "property=SomeMenuItemName" (used to be - "propertie=*****") Is not functioning as it used to.

if I use the option "menu=******" I can get results to show up in the skin, however forcing the name with "property=*****" returns no results under the correct menu item name.

Two things I personally need from the script is the ability to force the menu name eg:property=H​omePlayListOne and also the script being able to report back that the playlist used was for Movies,Episodes or Albums.

Cheers hey.

Edit By running

PHP Code:
XBMC.RunScript(script.randomandlastitems,limit=10,method=Random,playlist=special://profile/playlists/video/Unwatched Movies.xsp,property=Menu1) 

I need to enter

PHP Code:
$INFO[Window(home).Property(PlaylistRandomMovieMenu1.8.Title)] 

To get results but I need $INFO[Window(home).Property(Menu1.8.Title)]




RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - butchabay - 2012-12-29

Just tested now version 2.0.0

- movies method=Last working perfectly

to call the script for episodes i use method=Last too, is this still avaiable ? because i get a script error when calling episodes.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - mikebzh44 - 2012-12-29

I was playing with the script in Aeon Nox 4.0 and I wasn't able to display widgets for smart playlists.

Don't know if it's normal but AE set UNWATCHED parameter to blank and not to false by default.

I have add a test (line 594) :

elif 'unwatched=' in param:
UNWATCHED = param.replace('unwatched=', '')
if UNWATCHED == '':
UNWATCHED = 'False'


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - mikebzh44 - 2012-12-29

(2012-12-28, 22:54)Mudislander Wrote: @Martijn - I'll have time to check the script thoroughly tomorrow but ATM it looks like the script option "property=SomeMenuItemName" (used to be - "propertie=*****") Is not functioning as it used to.

if I use the option "menu=******" I can get results to show up in the skin, however forcing the name with "property=*****" returns no results under the correct menu item name.

Two things I personally need from the script is the ability to force the menu name eg:property=H​omePlayListOne and also the script being able to report back that the playlist used was for Movies,Episodes or Albums.

Cheers hey.

Edit By running

PHP Code:
XBMC.RunScript(script.randomandlastitems,limit=10,method=Random,playlist=special://profile/playlists/video/Unwatched Movies.xsp,property=Menu1) 

I need to enter

PHP Code:
$INFO[Window(home).Property(PlaylistRandomMovieMenu1.8.Title)] 

To get results but I need $INFO[Window(home).Property(Menu1.8.Title)]
I have do the same with Aeon Nox 4.0 :

In skin :

Code:
RunScript(script.randomandlastitems, type=Movie, playlist=special://profile/playlists/video/Parents.xsp, method=Latest, limit=10, unwatched=False, resume=False, property=SmartPlaylist1)

In script, I have change line 590/591 :

Code:
elif 'property=' in param:
                PROPERTY = param.replace('property=', '')

Just to be sure, I have put some debug in log file :

Code:
if PROPERTY == "":
            PROPERTY = "Playlist%s%s%s" % ( METHOD, TYPE, MENU )
            print("##### PROPERTY SET TO DEFAULT", PROPERTY)
        else:
            print("##### PROPERTY SET TO ", PROPERTY)

And property is OK :

Code:
16:52:51 T:4416  NOTICE: ('##### PROPERTY SET TO ', 'SmartPlaylist7')
16:52:51 T:4916  NOTICE: ('##### PROPERTY SET TO ', 'SmartPlaylist1')



RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Mudislander - 2012-12-29

@mikebzh44 Thanks - That gets movie playlists working.

Now I need to redo TVShow & music librararies on test machine to check them


Re: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Martijn - 2012-12-30

@mike
Could you pastebin.com your changes so I could see where I screwed up?
I'll add it to github too


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - mikebzh44 - 2012-12-30

Martijn, here my changes :

http://xbmclogs.com/show.php?id=24925

github will be great Wink


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Mudislander - 2013-01-01

Real welcoming message on github - "Nothing to see here yet. Move along." Big Grin


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - mikebzh44 - 2013-01-02

Martijn.

Aeon Nox 4.0 will be available soon on official repository and Phil call script this way :

Code:
RunScript(script.randomandlastitems, type=Movie, playlist=special://profile/playlists/video/Parents.xsp, method=Latest, limit=10, unwatched=False, resume=False, PROPERTY=SmartPlaylist1)

But if script now require property= parameter, widgets skin will be broken :S

Is there a smart way to handle this case in python ( uppercase ? lowercase ? double test ?) ?


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - phil65 - 2013-01-02

(2013-01-02, 10:49)mikebzh44 Wrote: Martijn.

Aeon Nox 4.0 will be available soon on official repository and Phil call script this way :

Code:
RunScript(script.randomandlastitems, type=Movie, playlist=special://profile/playlists/video/Parents.xsp, method=Latest, limit=10, unwatched=False, resume=False, PROPERTY=SmartPlaylist1)

But if script now require property= parameter, widgets skin will be broken :S

Is there a smart way to handle this case in python ( uppercase ? lowercase ? double test ?) ?

fixed that, ronie will pull with fix included.


RE: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - mikebzh44 - 2013-01-02

Good news Wink


Re: [RELEASE] Random and last items of video smartplaylist script for Skins / Skinners - Martijn - 2013-01-02

Updated in repo and put code on github.
@ mikebzh44
You have full rights so you can maintain it too Wink