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 smartplaylist script for Skins - mikebzh44 - 2014-01-07

There is no ERROR related to this script in the 2 debug log :S


RE: [RELEASE] Random and last items smartplaylist script for Skins - Mudislander - 2014-01-07

Yeah that's the one that works, but move the same playlist to the skin folder and then it doesn't work.


RE: [RELEASE] Random and last items smartplaylist script for Skins - mikebzh44 - 2014-01-07

So move your playlist in skin folder and get the error in the debug log before to post it on xbmclogs Wink

Thanks.


RE: [RELEASE] Random and last items smartplaylist script for Skins - butchabay - 2014-01-07

@Mudislander

Post the line calling the script and the playlist so i can test it and report back.


RE: [RELEASE] Random and last items smartplaylist script for Skins - Mudislander - 2014-01-08

(2014-01-07, 22:39)mikebzh44 Wrote: So move your playlist in skin folder and get the error in the debug log before to post it on xbmclogs Wink

Thanks.

Sorry misread your post, thought you only said 2nd log had no error Blush


@butchabay thanks for the offer - Can I take a rain check on that.


RE: [RELEASE] Random and last items smartplaylist script for Skins - tdoe - 2014-01-21

Hi all,

I've tried to integrate the current git version of the script to my confluence-mod. For Movies it is working as expected, but with Audio I have problems.
Is there a bug in the script, or have I done something wrong to integrate?

Here the onload Part of Home.xml

PHP Code:
XBMC.RunScript(script.randomandlastitems,limit=6,method=Last,playlist=special://skin/playlists/Audiobooks.xsp,menu=Menu2) 

The Audiobooks Playlist:

PHP Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="albums">
    <name>Audiobooks</name>
    <match>one</match>
    <rule field="genre" operator="contains">
        <value>Audio Book</value>
    </rule>
    <rule field="genre" operator="contains">
        <value>Audiobook</value>
    </rule>
    <rule field="genre" operator="contains">
        <value>audiobook</value>
    </rule>
    <rule field="genre" operator="contains">
        <value>audio book</value>
    </rule>
    <rule field="genre" operator="contains">
        <value>AUDIOBOOK</value>
    </rule>
    <rule field="genre" operator="contains">
        <value>AUDIO BOOK</value>
    </rule>
    <order direction="ascending">album</order>
</smartplaylist> 

And as example a snippet from

PHP Code:
<item>
        <
label>$INFO[Window.Property(PlaylistLastMusicMenu2.1.Title)]</label>
        <
label2>$INFO[Window.Property(PlaylistLastMusicMenu2.1.Artist)]</label2>
        <
onclick>PlayList.Clear</onclick>
        <
onclick>PlayMedia(&quot;$INFO[Window.Property(PlaylistLastMusicMenu2.1.Play)]&quot;)</onclick>
        <
icon>-</icon>
        <
thumb>$INFO[Window.Property(PlaylistLastMusicMenu2.1.Thumb)]</thumb>
</
item

Snippet of xbmc.log

PHP Code:
ERROREXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - 
NOTEIGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            
Error Type: <type 'exceptions.KeyError'>
                                            
Error Contents: ('artistid',)
                                            
Traceback (most recent call last):
                                              
File "/home/pi/.xbmc/addons/script.randomandlastitems/randomandlastitems.py"line 851in <module>
                                                
_getAlbumsFromPlaylist()
                                              
File "/home/pi/.xbmc/addons/script.randomandlastitems/randomandlastitems.py"line 532in _getAlbumsFromPlaylist
                                                _artistid 
_result[0]['artistid']
                                            
KeyError: ('artistid',)
                                            -->
End of Python script error report<-- 

The used XBMC Version is 12.2
The used script Version is 2.2.0

Does anyone know a solution for this?
Thanks in advance


RE: [RELEASE] Random and last items smartplaylist script for Skins - mikebzh44 - 2014-01-21

Could you share (dropbox, rapidshare, ...) your MyMusic32.db ?


RE: [RELEASE] Random and last items smartplaylist script for Skins - mikebzh44 - 2014-01-21

It's because the song in album "Tron hörspiel" did not have artist (in MP3 tag) :

Image

As you can see, field strArtists is blank :

Image

Your other audiobooks, such as Inferno, are OK :

Image

Field strArtists is OK for every song :

Image

Sakrileg is fine too but you will have the same problem with ID4 Idependance Day :

Image


RE: [RELEASE] Random and last items smartplaylist script for Skins - tdoe - 2014-01-21

Thanks, for your fast help, thats it!


RE: [RELEASE] Random and last items smartplaylist script for Skins - Rantanplan-1 - 2014-01-30

First of all: Thanks for all the Effort invested in this Script.

Works fine on my End (now)!

Request:
Would it be possible to add "Recent/inProgress" as method?

At the Moment i use a separate/additional Smartplaylist to show me recent (inProgress) Movies, in the Skin Widged.
PHP Code:
<rule field="inprogress" operator="true" /> 
.
It would be cool if I just could use this Script to show me Recent items of a Smartplaylist, insted to copy-paste a existing Smartplaylist, and add in one of them the additional rule. to finaly show it in the widget.

Regards.


RE: [RELEASE] Random and last items smartplaylist script for Skins - mikebzh44 - 2014-01-30

No, you have to create separate smart playlists.


RE: [RELEASE] Random and last items smartplaylist script for Skins - Rantanplan-1 - 2014-01-30

Thanks for your reply.

Think ",method=Last,resume=True" shuld do the job for me, wll give it a try. Thanks.


RE: [RELEASE] Random and last items smartplaylist script for Skins - denywinarto - 2014-02-03

Hi Mike, got a question, any idea what this error is about?
I'm trying to create Latest/random genre movies, e.g latest action movies

Code:
09:11:56 T:6936   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'nodeValue'
                                            Traceback (most recent call last):
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 723, in <module>
                                                _parse_argv()
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 644, in _parse_argv
                                                _getPlaylistType ();
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 57, in _getPlaylistType
                                                _name = _doc.getElementsByTagName('name')[0].firstChild.nodeValue.encode('utf-8')
                                            AttributeError: 'NoneType' object has no attribute 'nodeValue'
                                            -->End of Python script error report<--

I'm trying to mod Ace's main menu with genres,
the playlist is like this :

Code:
    <onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(fav101.path)) + SubString(skin.string(mfvpl101_list),latest)">RunScript(script.randomandlastitems,limit=12,method=Last,playlist=$INFO[Skin.String(fav101.path)],menu=Menu101)</onload>    
    <onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(fav101.path)) + SubString(skin.string(mfvpl101_list),random)">RunScript(script.randomandlastitems,limit=12,method=Random,playlist=special://masterprofile/playlists/video/Film_Action.xsp,menu=Menu101, daemon=True)</onload>

The playlist works correctly when i open it.
Thanks

Seems like the "latest" method only reads path, not playlist.
While genre can not be defined with path..

When i force it to read from movie.db, like this:

Code:
skin.ace.fav101.path">ActivateWindow(10025,videodb://1/1/1/,return)

it gives me this error

Code:
11:37:36 T:5108   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IOError'>
                                            Error Contents: (22, "invalid mode ('rb') or filename", 'ActivateWindow(10025,videodb://1/1/1/,return)')
                                            Traceback (most recent call last):
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 723, in <module>
                                                _parse_argv()
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 644, in _parse_argv
                                                _getPlaylistType ();
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 46, in _getPlaylistType
                                                _doc = parse(xbmc.translatePath(PLAYLIST))
                                              File "S:\Program Files\XBMC\system\python\Lib\xml\dom\minidom.py", line 1918, in parse
                                                return expatbuilder.parse(file)
                                              File "S:\Program Files\XBMC\system\python\Lib\xml\dom\expatbuilder.py", line 922, in parse
                                                fp = open(file, 'rb')
                                            IOError: (22, "invalid mode ('rb') or filename", 'ActivateWindow(10025,videodb://1/1/1/,return)')
                                            -->End of Python script error report<--

Onclick method works for above path so it's not syntax error
Code:
<onclick>ActivateWindow(10025,videodb://1/1/1/)</onclick>

Anyone successfully implemented thie script with genre?


RE: [RELEASE] Random and last items smartplaylist script for Skins - mikebzh44 - 2014-02-03

[quote='denywinarto' pid='1617925' dateline='1391397832']
Hi Mike, got a question, any idea what this error is about?
I'm trying to create Latest/random genre movies, e.g latest action movies

Code:
09:11:56 T:6936   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'nodeValue'
                                            Traceback (most recent call last):
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 723, in <module>
                                                _parse_argv()
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 644, in _parse_argv
                                                _getPlaylistType ();
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 57, in _getPlaylistType
                                                _name = _doc.getElementsByTagName('name')[0].firstChild.nodeValue.encode('utf-8')
                                            AttributeError: 'NoneType' object has no attribute 'nodeValue'
                                            -->End of Python script error report<--

Please paste here the content of your XSP file.


RE: [RELEASE] Random and last items smartplaylist script for Skins - denywinarto - 2014-02-03

(2014-02-03, 10:42)mikebzh44 Wrote: Hi Mike, got a question, any idea what this error is about?
I'm trying to create Latest/random genre movies, e.g latest action movies

Code:
09:11:56 T:6936   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'nodeValue'
                                            Traceback (most recent call last):
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 723, in <module>
                                                _parse_argv()
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 644, in _parse_argv
                                                _getPlaylistType ();
                                              File "S:\Users\Administrator\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 57, in _getPlaylistType
                                                _name = _doc.getElementsByTagName('name')[0].firstChild.nodeValue.encode('utf-8')
                                            AttributeError: 'NoneType' object has no attribute 'nodeValue'
                                            -->End of Python script error report<--

Please paste here the content of your XSP file.

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name></name>
    <match>all</match>
    <rule field="genre" operator="is">
        <value>Action</value>
    </rule>
</smartplaylist>

It works correctly on playlist menu..


This forum uses Lukasz Tkacz MyBB addons.